diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index b5664d459ace1..f21c4f55f32b3 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -106,3 +106,6 @@ enable_quic_proxies_for_https_urls.patch fix_svg_crash_for_v0_distribution_into_foreignobject.patch filesystem_harden_against_overflows_of_operationid_a_bit_better.patch fix_uap_in_imagebitmaploader_filereaderloader.patch +fire_caret_location_change_when_focus_moves_from_ui_to_content.patch +do_not_show_virtual_keyboard_for_all_mouse_inputs.patch +setup_the_observer_before_calling_displayvirtualkeyboard.patch diff --git a/patches/common/chromium/browser_compositor_mac.patch b/patches/common/chromium/browser_compositor_mac.patch index cb6210eb21cbf..9aad97014a7f1 100644 --- a/patches/common/chromium/browser_compositor_mac.patch +++ b/patches/common/chromium/browser_compositor_mac.patch @@ -29,7 +29,7 @@ diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/cont index 92afcc77910610e53378f55adc003cc1bdf3109a..42bd6fd7c169de36c775471c68b456f1386ff666 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -81,6 +81,12 @@ +@@ -81,6 +81,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { DCHECK_EQ(1u, num_erased); } diff --git a/patches/common/chromium/crashpad_http_status.patch b/patches/common/chromium/crashpad_http_status.patch index 4f7a9ff88725c..1acbc21e8fc82 100644 --- a/patches/common/chromium/crashpad_http_status.patch +++ b/patches/common/chromium/crashpad_http_status.patch @@ -22,7 +22,7 @@ diff --git a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm b/thir index 8d5f78cc6efc8b8e349958f51c78921a8c163c4e..a433bb357da5865144ade7d3663b1c9b36199f8e 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm +++ b/third_party/crashpad/crashpad/util/net/http_transport_mac.mm -@@ -293,7 +293,7 @@ static void Unschedule(CFReadStreamRef stream, +@@ -293,7 +293,7 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) { return false; } NSInteger http_status = [http_response statusCode]; diff --git a/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch b/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch new file mode 100644 index 0000000000000..7741f5dc4576f --- /dev/null +++ b/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch @@ -0,0 +1,253 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lan Wei +Date: Tue, 11 Sep 2018 19:41:33 +0000 +Subject: Do not show virtual keyboard for all mouse inputs + +We have an issue that Windows virtual Keyboard appears whenever a text +area is selected with the mouse or keyboard. Since we decide to only +show the virtual keyboard when the input type is touch. + +Bug: 871756 +Change-Id: Ia804afad907341ed478409d223b67f09c6b7f8f3 +Reviewed-on: https://chromium-review.googlesource.com/1194406 +Reviewed-by: Pavel Feldman +Reviewed-by: Marc Treib +Reviewed-by: Keigo Oka +Reviewed-by: Lei Zhang +Reviewed-by: Navid Zolghadr +Reviewed-by: Sadrul Chowdhury +Commit-Queue: Lan Wei +Cr-Commit-Position: refs/heads/master@{#590440} + +diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +index 5c8bdc8c73dc2047175f16c658428c9f2c038412..f7c8c33b3d6764116e0713244e446356873e015f 100644 +--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc ++++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +@@ -1154,6 +1154,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + + // Set |TextInputState.show_ime_if_needed| to true. Expect IME. + sender.SetShowVirtualKeyboardIfEnabled(true); ++#if defined(OS_WIN) ++ sender.SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); ++#endif + EXPECT_TRUE(send_and_check_show_ime()); + + // Send the same message. Expect IME (no change). +@@ -1171,6 +1174,12 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + sender.SetShowVirtualKeyboardIfEnabled(true); + EXPECT_TRUE(send_and_check_show_ime()); + ++#if defined(OS_WIN) ++ // Set input type to mouse. Expect no IME. ++ sender.SetLastPointerType(ui::EventPointerType::POINTER_TYPE_MOUSE); ++ EXPECT_FALSE(send_and_check_show_ime()); ++#endif ++ + // Set |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE. Expect no IME. + sender.SetType(ui::TEXT_INPUT_TYPE_NONE); + EXPECT_FALSE(send_and_check_show_ime()); +diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc +index 1445829a89caaeeea602cd050b9c3bf0161f5881..0bb77fbfee6a4c08ce261bbc4846c8ec0755b01a 100644 +--- a/chrome/browser/ui/search/search_tab_helper.cc ++++ b/chrome/browser/ui/search/search_tab_helper.cc +@@ -271,7 +271,9 @@ void SearchTabHelper::FocusOmnibox(OmniboxFocusState state) { + // visual cue to users who really understand selection state about what + // will happen if they start typing. + omnibox_view->SelectAll(false); ++#if !defined(OS_WIN) + omnibox_view->ShowVirtualKeyboardIfEnabled(); ++#endif + break; + case OMNIBOX_FOCUS_NONE: + // Remove focus only if the popup is closed. This will prevent someone +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index 0eec5c7a6861f189192ab0cf8b3dbb3b452292e0..de9490d94d98afa6812e81b0cf50fb4adc81887c 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -756,9 +756,11 @@ void RenderWidgetHostViewAura::FocusedNodeTouched(bool editable) { + return; + auto* controller = input_method->GetInputMethodKeyboardController(); + if (editable && host()->GetView() && host()->delegate()) { +- keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); +- if (!controller->DisplayVirtualKeyboard()) +- keyboard_observer_.reset(nullptr); ++ keyboard_observer_.reset(nullptr); ++ if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH && ++ controller->DisplayVirtualKeyboard()) { ++ keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); ++ } + virtual_keyboard_requested_ = keyboard_observer_.get(); + } else { + virtual_keyboard_requested_ = false; +@@ -2341,9 +2343,16 @@ void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled( + const TextInputState* state = text_input_manager_->GetTextInputState(); + if (state && state->type != ui::TEXT_INPUT_TYPE_NONE && + state->mode != ui::TEXT_INPUT_MODE_NONE) { ++ bool show_virtual_keyboard = true; ++#if defined(OS_WIN) ++ show_virtual_keyboard = ++ last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH; ++#endif + if (state->show_ime_if_needed && +- GetInputMethod()->GetTextInputClient() == this) ++ GetInputMethod()->GetTextInputClient() == this && ++ show_virtual_keyboard) { + GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ } + // Ensure that accessibility events are fired when the selection location + // moves from UI back to content. + text_input_manager->NotifySelectionBoundsChanged(updated_view); +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h +index 5f75e19c4a9fa8aaa57882dcbb094a73199f50d0..2257552851e933a06cb9addbee00e511573561ec 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.h ++++ b/content/browser/renderer_host/render_widget_host_view_aura.h +@@ -342,6 +342,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura + + void ScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); + ++ // TODO(lanwei): Use TestApi interface to write functions that are used in ++ // tests and remove FRIEND_TEST_ALL_PREFIXES. ++ void SetLastPointerType(ui::EventPointerType last_pointer_type) { ++ last_pointer_type_ = last_pointer_type; ++ } ++ + protected: + ~RenderWidgetHostViewAura() override; + +@@ -408,6 +414,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura + DiscardDelegatedFramesWithMemoryPressure); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraKeyboardTest, + KeyboardObserverDestroyed); ++ FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraKeyboardTest, ++ KeyboardObserverForOnlyTouchInput); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraSurfaceSynchronizationTest, + DropFallbackWhenHidden); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraSurfaceSynchronizationTest, +diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +index 9aac9b4c740245727124991a750a36b54f3d7ac5..f7b9e13226b1896028044d389ace5383554b5dce 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +@@ -6735,6 +6735,7 @@ class RenderWidgetHostViewAuraKeyboardTest + }; + + TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverDestroyed) { ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); + parent_view_->FocusedNodeTouched(true); + EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr); + EXPECT_EQ(keyboard_controller_observer_count(), 1u); +@@ -6744,6 +6745,20 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverDestroyed) { + EXPECT_EQ(keyboard_controller_observer_count(), 0u); + } + ++TEST_F(RenderWidgetHostViewAuraKeyboardTest, ++ KeyboardObserverForOnlyTouchInput) { ++ // Show virtual keyboard for touch inputs. ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); ++ parent_view_->FocusedNodeTouched(true); ++ EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr); ++ EXPECT_EQ(keyboard_controller_observer_count(), 1u); ++ // Do not show virtual keyboard for mouse inputs. ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_MOUSE); ++ parent_view_->FocusedNodeTouched(true); ++ EXPECT_EQ(parent_view_->keyboard_observer_.get(), nullptr); ++ EXPECT_EQ(keyboard_controller_observer_count(), 0u); ++} ++ + #endif // defined(OS_WIN) + + } // namespace content +diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc +index 3d27041d9cfae4d87e4b2b26983f7a004ffc31d9..2d724b57c213052b184fc3b4c012bb0d8ad25b50 100644 +--- a/content/public/test/text_input_test_utils.cc ++++ b/content/public/test/text_input_test_utils.cc +@@ -186,7 +186,7 @@ class TestRenderWidgetHostViewDestructionObserver::InternalObserver + DISALLOW_COPY_AND_ASSIGN(InternalObserver); + }; + +-#ifdef USE_AURA ++#if defined(USE_AURA) + class InputMethodObserverAura : public TestInputMethodObserver, + public ui::InputMethodObserver { + public: +@@ -453,6 +453,15 @@ void TextInputStateSender::SetShowVirtualKeyboardIfEnabled( + text_input_state_->show_ime_if_needed = show_ime_if_needed; + } + ++#if defined(USE_AURA) ++void TextInputStateSender::SetLastPointerType( ++ ui::EventPointerType last_pointer_type) { ++ RenderWidgetHostViewAura* rwhva = ++ static_cast(view_); ++ rwhva->SetLastPointerType(last_pointer_type); ++} ++#endif ++ + TestInputMethodObserver::TestInputMethodObserver() {} + + TestInputMethodObserver::~TestInputMethodObserver() {} +@@ -462,7 +471,7 @@ std::unique_ptr TestInputMethodObserver::Create( + WebContents* web_contents) { + std::unique_ptr observer; + +-#ifdef USE_AURA ++#if defined(USE_AURA) + RenderWidgetHostViewAura* view = static_cast( + web_contents->GetRenderWidgetHostView()); + observer.reset(new InputMethodObserverAura(view->GetInputMethod())); +diff --git a/content/public/test/text_input_test_utils.h b/content/public/test/text_input_test_utils.h +index d438b72e176adbcb1240848c223596ffef2c558d..2bb337c19de138a106f8f3fe8c631aa8ca717df5 100644 +--- a/content/public/test/text_input_test_utils.h ++++ b/content/public/test/text_input_test_utils.h +@@ -17,6 +17,10 @@ + #include "content/public/browser/browser_message_filter.h" + #endif + ++#if defined(USE_AURA) ++#include "ui/events/event_constants.h" ++#endif ++ + namespace ipc { + class Message; + } +@@ -194,6 +198,9 @@ class TextInputStateSender { + void SetFlags(int flags); + void SetCanComposeInline(bool can_compose_inline); + void SetShowVirtualKeyboardIfEnabled(bool show_ime_if_needed); ++#if defined(USE_AURA) ++ void SetLastPointerType(ui::EventPointerType last_pointer_type); ++#endif + + private: + std::unique_ptr text_input_state_; +diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc +index c9a96b43788835476310c96b71b1ced21737a3c3..7963a4d1912eb8ba03d46dd353665f977680a2c5 100644 +--- a/ui/views/controls/textfield/textfield.cc ++++ b/ui/views/controls/textfield/textfield.cc +@@ -666,7 +666,9 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& event) { + (event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton())) { + if (!had_focus) + RequestFocusWithPointer(ui::EventPointerType::POINTER_TYPE_MOUSE); ++#if !defined(OS_WIN) + ShowVirtualKeyboardIfEnabled(); ++#endif + } + + #if defined(OS_LINUX) && !defined(OS_CHROMEOS) +@@ -743,10 +745,16 @@ bool Textfield::OnKeyReleased(const ui::KeyEvent& event) { + } + + void Textfield::OnGestureEvent(ui::GestureEvent* event) { ++ bool show_virtual_keyboard = true; ++#if defined(OS_WIN) ++ show_virtual_keyboard = event->details().primary_pointer_type() == ++ ui::EventPointerType::POINTER_TYPE_TOUCH; ++#endif + switch (event->type()) { + case ui::ET_GESTURE_TAP_DOWN: + RequestFocusWithPointer(event->details().primary_pointer_type()); +- ShowVirtualKeyboardIfEnabled(); ++ if (show_virtual_keyboard) ++ ShowVirtualKeyboardIfEnabled(); + event->SetHandled(); + break; + case ui::ET_GESTURE_TAP: diff --git a/patches/common/chromium/enable_quic_proxies_for_https_urls.patch b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch index ec9fc99380115..015ce7e33dc98 100644 --- a/patches/common/chromium/enable_quic_proxies_for_https_urls.patch +++ b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch @@ -1,9 +1,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sun, 31 Mar 2019 21:12:59 +0200 -Subject: =?UTF-8?q?Enable=20support=20for=20sending=20HTTPS=20URLs=20via?= - =?UTF-8?q?=20QUIC=20proxies=20only=20when=0Athe=20finch=20param=20enable?= - =?UTF-8?q?=5Fquic=5Fproxies=5Ffor=5Fhttps=5Furls=20is=20set.?= +Subject: Enable support for sending HTTPS URLs via QUIC proxies only when the + finch param enable_quic_proxies_for_https_urls is set. Backports: - https://chromium-review.googlesource.com/c/chromium/src/+/1377709 diff --git a/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch index 789949d398a7e..291052f760743 100644 --- a/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch +++ b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Tue, 29 Jan 2019 19:51:07 +0000 -Subject: [FileSystem] Harden against overflows of OperationID a bit better. +Subject: Harden against overflows of OperationID a bit better. Rather than having a UAF when OperationID overflows instead overwrite the old operation with the new one. Can still cause weirdness, but at diff --git a/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch b/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch new file mode 100644 index 0000000000000..fcc68573e545e --- /dev/null +++ b/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch @@ -0,0 +1,131 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aaron Leventhal +Date: Wed, 25 Jul 2018 14:05:53 +0000 +Subject: Fire caret location change when focus moves from UI to content + +When focus moves from UI back into content, but the same content element +is focused as was previously, an accessibility event must be fired for +the caret location change, as it is no longer in the UI. + +This fix assists screen magnification software that must track the caret +location. + +Bug: 864563 +Change-Id: Ie9cc745288c124ddd73a54906c41dc16e07b9ff6 +Reviewed-on: https://chromium-review.googlesource.com/1140199 +Reviewed-by: Sadrul Chowdhury +Reviewed-by: Kinuko Yasuda +Reviewed-by: Dominic Mazzoni +Commit-Queue: Aaron Leventhal +Cr-Commit-Position: refs/heads/master@{#577868} + +diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +index c06ff416d83c943731166501260a7a4d9b36b078..5c8bdc8c73dc2047175f16c658428c9f2c038412 100644 +--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc ++++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +@@ -10,6 +10,8 @@ + #include "build/build_config.h" + #include "chrome/browser/chrome_content_browser_client.h" + #include "chrome/browser/ui/browser.h" ++#include "chrome/browser/ui/browser_window.h" ++#include "chrome/browser/ui/location_bar/location_bar.h" + #include "chrome/browser/ui/tabs/tab_strip_model.h" + #include "chrome/test/base/in_process_browser_test.h" + #include "chrome/test/base/interactive_test_utils.h" +@@ -639,6 +641,41 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + reset_state_observer.Wait(); + } + ++#if defined(USE_AURA) ++// This test creates a blank page and adds an to it. Then, the ++// is focused, UI is focused, then the input is refocused. The test verifies ++// that selection bounds change with the refocus (see https://crbug.com/864563). ++IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, ++ SelectionBoundsChangeAfterRefocusInput) { ++ CreateIframePage("a()"); ++ content::RenderFrameHost* main_frame = GetFrame(IndexVector{}); ++ content::RenderWidgetHostView* view = main_frame->GetView(); ++ content::WebContents* web_contents = active_contents(); ++ AddInputFieldToFrame(main_frame, "text", "", false); ++ ++ auto focus_input_and_wait_for_selection_bounds_change = ++ [&main_frame, &web_contents, &view]() { ++ ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view); ++ // SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB, ++ // ui::VKEY_TAB, false, true, false, false); ++ EXPECT_TRUE(ExecuteScript(main_frame, ++ "document.querySelector('input').focus();")); ++ bounds_observer.Wait(); ++ }; ++ ++ focus_input_and_wait_for_selection_bounds_change(); ++ ++ // Focus location bar. ++ BrowserWindow* window = browser()->window(); ++ ASSERT_TRUE(window); ++ LocationBar* location_bar = window->GetLocationBar(); ++ ASSERT_TRUE(location_bar); ++ location_bar->FocusLocation(true); ++ ++ focus_input_and_wait_for_selection_bounds_change(); ++} ++#endif ++ + // This test verifies that if we have a focused in the main frame and + // the tab is closed, TextInputManager handles unregistering itself and + // notifying the observers properly (see https://crbug.com/669375). +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index 09168578786f9ecfa3e1c44b134d7fe76af9504c..0eec5c7a6861f189192ab0cf8b3dbb3b452292e0 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -2339,11 +2339,14 @@ void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled( + GetInputMethod()->OnTextInputTypeChanged(this); + + const TextInputState* state = text_input_manager_->GetTextInputState(); +- if (state && state->show_ime_if_needed && +- state->type != ui::TEXT_INPUT_TYPE_NONE && +- state->mode != ui::TEXT_INPUT_MODE_NONE && +- GetInputMethod()->GetTextInputClient() == this) { +- GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ if (state && state->type != ui::TEXT_INPUT_TYPE_NONE && ++ state->mode != ui::TEXT_INPUT_MODE_NONE) { ++ if (state->show_ime_if_needed && ++ GetInputMethod()->GetTextInputClient() == this) ++ GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ // Ensure that accessibility events are fired when the selection location ++ // moves from UI back to content. ++ text_input_manager->NotifySelectionBoundsChanged(updated_view); + } + + if (auto* render_widget_host = updated_view->host()) { +diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc +index 24f32e7228aa2b7ece229312a79cc0c95251a31f..ce3a5ff83cf2e0ca9e3cda56308b3b00f6471f16 100644 +--- a/content/browser/renderer_host/text_input_manager.cc ++++ b/content/browser/renderer_host/text_input_manager.cc +@@ -209,6 +209,11 @@ void TextInputManager::SelectionBoundsChanged( + selection_region_map_[view].first_selection_rect.set_size( + params.anchor_rect.size()); + ++ NotifySelectionBoundsChanged(view); ++} ++ ++void TextInputManager::NotifySelectionBoundsChanged( ++ RenderWidgetHostViewBase* view) { + for (auto& observer : observer_list_) + observer.OnSelectionBoundsChanged(this, view); + } +diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h +index 8e4ecfe5be2defa1578eec9be3c713be0b07e84d..d145a992144079401817e2e24f664576c493b3fb 100644 +--- a/content/browser/renderer_host/text_input_manager.h ++++ b/content/browser/renderer_host/text_input_manager.h +@@ -184,6 +184,10 @@ class CONTENT_EXPORT TextInputManager { + void SelectionBoundsChanged(RenderWidgetHostViewBase* view, + const ViewHostMsg_SelectionBounds_Params& params); + ++ // Notify observers that the selection bounds have been updated. This is also ++ // called when a view with a selection is reactivated. ++ void NotifySelectionBoundsChanged(RenderWidgetHostViewBase* view); ++ + // Called when the composition range and/or character bounds have changed. + void ImeCompositionRangeChanged( + RenderWidgetHostViewBase* view, diff --git a/patches/common/chromium/intersection-observer.patch b/patches/common/chromium/intersection-observer.patch index e9e145ec5f6c2..208a45f8601eb 100644 --- a/patches/common/chromium/intersection-observer.patch +++ b/patches/common/chromium/intersection-observer.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 27 Mar 2019 23:27:40 +0100 -Subject: [IntersectionObserver] Report coordinates as CSS pixels. +Subject: Report coordinates as CSS pixels. Prior to this patch, IntersectionObserverEntry was reporting coordinates in device pixels. diff --git a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch index 5bae6c27ef777..151a530df4e06 100644 --- a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch +++ b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch @@ -56,7 +56,7 @@ diff --git a/services/service_manager/sandbox/mac/sandbox_mac.mm b/services/serv index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d11379837708bdde79d 100644 --- a/services/service_manager/sandbox/mac/sandbox_mac.mm +++ b/services/service_manager/sandbox/mac/sandbox_mac.mm -@@ -81,6 +81,21 @@ +@@ -81,6 +81,21 @@ static_assert(arraysize(kDefaultSandboxTypeToResourceIDMapping) == size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), "sandbox type to resource id mapping incorrect"); @@ -78,7 +78,7 @@ index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d1137983770 } // namespace // Static variable declarations. -@@ -242,6 +257,9 @@ +@@ -242,6 +257,9 @@ bool SandboxMac::Enable(SandboxType sandbox_type) { if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013)) return false; diff --git a/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch b/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch index 0f6130fac6b69..f80f539264d7e 100644 --- a/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch +++ b/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch @@ -13,7 +13,7 @@ Reviewed-by: John Abd-El-Malek Cr-Commit-Position: refs/heads/master@{#620910} diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc -index 665718d90bf66061f92164c2715f5e500608beb5..63b88c0051354eab316edd16c522b3c7f89158ca 100644 +index e2afc34bd98f6a6cc76132dc4d1f8ca5c84afbaf..1a86063573849d5e174603ce418beebd103120d3 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc @@ -66,7 +66,6 @@ @@ -96,10 +96,10 @@ index 0000000000000000000000000000000000000000..e47cbbf08076216f60f0d01942626f16 + +} // namespace content diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987cced36324 100644 +index 35fdb9d351db5a6bdaa61742ec49dc75fe70cfa4..c72025ad2e825d3c7f8136434587bcebf8f858e0 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2793,6 +2793,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2782,6 +2782,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( static const char* const kSwitchNames[] = { switches::kDisableColorCorrectRendering, network::switches::kNoReferrers, @@ -107,7 +107,7 @@ index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987c service_manager::switches::kDisableInProcessStackTraces, service_manager::switches::kDisableSeccompFilterSandbox, service_manager::switches::kNoSandbox, -@@ -2875,7 +2876,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2863,7 +2864,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kEnableWebGLDraftExtensions, switches::kEnableWebGLImageChromium, switches::kEnableWebVR, @@ -116,7 +116,7 @@ index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987c switches::kFMPNetworkQuietTimeout, switches::kForceColorProfile, diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 074f290638ff7311d6c9683a63f7a7c39a402876..5e1c9138bcf604831fca12a9673675e0d9d4734f 100644 +index 9d7c9791bd99c361a9ba3edc539d9b48b46659d4..3d11373b77af8bc0db42a27fcfab3089f8aaed1c 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -286,6 +286,7 @@ bool UtilityProcessHost::StartProcess() { @@ -128,10 +128,10 @@ index 074f290638ff7311d6c9683a63f7a7c39a402876..5e1c9138bcf604831fca12a9673675e0 #if defined(OS_MACOSX) service_manager::switches::kEnableSandboxLogging, diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc -index eeb540ba52e109aff7348714a0ad22399a460a2d..512d0bb910bf9d5091943a5a40b253ad7ac43e65 100644 +index 19c2246a3bd8dcc3d1e070b74ff3d416adc473fe..cdf81f6c35cd78b4fff4d666284d0615e6c057c6 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc -@@ -473,10 +473,6 @@ const char kEnableWebVR[] = "enable-webvr"; +@@ -469,10 +469,6 @@ const char kEnableWebVR[] = "enable-webvr"; // Enable rasterizer that writes directly to GPU memory associated with tiles. const char kEnableZeroCopy[] = "enable-zero-copy"; @@ -143,10 +143,10 @@ index eeb540ba52e109aff7348714a0ad22399a460a2d..512d0bb910bf9d5091943a5a40b253ad // be shared between processes. The argument to this switch is the handle id // (pointer on Windows) as a string, followed by a comma, then the size of the diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h -index 2a08de6a59bb67bfe0f65f82f6ba3397a4896056..f420773ee9fe29e5562878ded07ad98ad6700e5f 100644 +index 2c795e814b13961eb190d5c7f9bce3c854dbfc17..a4da6292e7c5784e06e686cd62e017b010fa7e27 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h -@@ -148,7 +148,6 @@ CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[]; +@@ -147,7 +147,6 @@ CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[]; CONTENT_EXPORT extern const char kEnableWebGLImageChromium[]; CONTENT_EXPORT extern const char kEnableWebVR[]; CONTENT_EXPORT extern const char kEnableZeroCopy[]; @@ -155,7 +155,7 @@ index 2a08de6a59bb67bfe0f65f82f6ba3397a4896056..f420773ee9fe29e5562878ded07ad98a CONTENT_EXPORT extern const char kFileUrlPathAlias[]; CONTENT_EXPORT extern const char kForceDisplayList2dCanvas[]; diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 2e17bf6f1522d3f8557b5d4bac0fb76fec034418..44df5d5461c718d2a793171d3592691c7bba12c8 100644 +index 5c31ab7654d0168d232e9974105573fa01543aed..b670c95891ab80e749209a843d958ffcbdcc6ba2 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -143,6 +143,7 @@ @@ -180,7 +180,7 @@ index 2e17bf6f1522d3f8557b5d4bac0fb76fec034418..44df5d5461c718d2a793171d3592691c } } diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 9e705c8b905c21db05b9e6461c31b0cea7d30980..dab1cfc7e2dd3ad65e9a554362f159970eb5cbd4 100644 +index 15a64a49d5c821d3cb10b9dfd99725296e6a912c..a28467ec68e2b63964e396977c17a2cbb5cf2407 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -791,6 +791,7 @@ test("content_browsertests") { @@ -192,7 +192,7 @@ index 9e705c8b905c21db05b9e6461c31b0cea7d30980..dab1cfc7e2dd3ad65e9a554362f15997 "../browser/network_service_browsertest.cc", "../browser/network_service_restart_browsertest.cc", diff --git a/services/network/network_service.cc b/services/network/network_service.cc -index e4cf8022f4d017321fb2f684ec0ade3bbd122df3..d22a74c6a8d7cc2e3acc1f0adc15f4b3a6b47867 100644 +index a91a9f4b5866c11ae76e2d173a92579f0b7d12a1..404c3fa8316abdd77b492468e29a577c0c9c0988 100644 --- a/services/network/network_service.cc +++ b/services/network/network_service.cc @@ -19,6 +19,7 @@ @@ -218,7 +218,7 @@ index e4cf8022f4d017321fb2f684ec0ade3bbd122df3..d22a74c6a8d7cc2e3acc1f0adc15f4b3 // per-NetworkContext basis. UMA_HISTOGRAM_BOOLEAN( diff --git a/services/network/public/cpp/network_switches.cc b/services/network/public/cpp/network_switches.cc -index 8b2d4ed3b39e35e1a078ad26a946cc752a830310..60859bc46e6420165a11e2c4bd03dcd81345b122 100644 +index 7790a6fa6e749f0f87d104f0175ad76d5aace108..6e489aafa30155fbbf75edfbffd17f93159e5665 100644 --- a/services/network/public/cpp/network_switches.cc +++ b/services/network/public/cpp/network_switches.cc @@ -37,6 +37,10 @@ const char kLogNetLog[] = "log-net-log"; @@ -233,7 +233,7 @@ index 8b2d4ed3b39e35e1a078ad26a946cc752a830310..60859bc46e6420165a11e2c4bd03dcd8 } // namespace network diff --git a/services/network/public/cpp/network_switches.h b/services/network/public/cpp/network_switches.h -index 83e78d0f3f705dc4082992ad8147bb5145308152..db64e5af747369823f91eb5d596ecb6f0cf94f96 100644 +index 3829a2d4360e6b04fc348712f236451ee704c575..28edfb93d4eaa3797a24691772850dc0009d50c9 100644 --- a/services/network/public/cpp/network_switches.h +++ b/services/network/public/cpp/network_switches.h @@ -18,6 +18,7 @@ COMPONENT_EXPORT(NETWORK_CPP) diff --git a/patches/common/chromium/mas-cfisobjc.patch b/patches/common/chromium/mas-cfisobjc.patch index 180423f3b8ede..c1dc41702a15b 100644 --- a/patches/common/chromium/mas-cfisobjc.patch +++ b/patches/common/chromium/mas-cfisobjc.patch @@ -9,7 +9,7 @@ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e25fe7ca21 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm -@@ -26,7 +26,6 @@ +@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID(); #if !defined(OS_IOS) CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); @@ -17,7 +17,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 #endif } // extern "C" -@@ -325,8 +324,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { +@@ -325,8 +324,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || @@ -27,7 +27,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 return ns_val; } -@@ -394,9 +392,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { +@@ -394,9 +392,6 @@ CFCast(const CFTypeRef& cf_val) { return (CTFontRef)(cf_val); } diff --git a/patches/common/chromium/mas_blink_no_private_api.patch b/patches/common/chromium/mas_blink_no_private_api.patch index 3870d2481d5d6..d687746c3eceb 100644 --- a/patches/common/chromium/mas_blink_no_private_api.patch +++ b/patches/common/chromium/mas_blink_no_private_api.patch @@ -18,7 +18,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not -@@ -39,38 +40,53 @@ +@@ -39,38 +40,53 @@ NSString* _NSYankFromKillRing(); void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } @@ -92,7 +92,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 namespace blink { -@@ -73,10 +75,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, +@@ -73,10 +75,12 @@ bool ThemePainterMac::PaintTextField(const Node* node, // behavior change while remaining a fragile solution. // https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3 if (!use_ns_text_field_cell) { @@ -105,7 +105,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 return false; } -@@ -162,10 +166,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, +@@ -162,10 +166,12 @@ bool ThemePainterMac::PaintTextArea(const Node* node, const PaintInfo& paint_info, const IntRect& r) { LocalCurrentGraphicsContext local_context(paint_info.context, r); diff --git a/patches/common/chromium/mas_no_private_api.patch b/patches/common/chromium/mas_no_private_api.patch index 3df25dff8d7b0..e63ef305d557a 100644 --- a/patches/common/chromium/mas_no_private_api.patch +++ b/patches/common/chromium/mas_no_private_api.patch @@ -41,7 +41,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/cont index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518325ef70a 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -135,6 +135,7 @@ +@@ -135,6 +135,7 @@ NSDictionary* attributeToMethodNameMap = nil; // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -49,7 +49,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -341,6 +342,7 @@ void AddMisspelledTextAttributes( +@@ -341,6 +342,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange( AddMisspelledTextAttributes(text_only_objects, attributed_text); return [attributed_text attributedSubstringFromRange:range]; } @@ -57,7 +57,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute( -@@ -595,7 +597,9 @@ + (void)initialize { +@@ -595,7 +597,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; {NSAccessibilityDOMIdentifierAttribute, @"domIdentifier"}, {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -67,7 +67,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -630,13 +634,17 @@ + (void)initialize { +@@ -630,13 +634,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -85,7 +85,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1114,6 +1122,7 @@ - (NSNumber*)enabled { +@@ -1114,6 +1122,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; ax::mojom::Restriction::kDisabled]; } @@ -93,7 +93,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1124,6 +1133,7 @@ - (id)endTextMarker { +@@ -1124,6 +1133,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfAnchor()); } @@ -101,7 +101,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSNumber*)expanded { if (![self instanceActive]) -@@ -2029,6 +2039,7 @@ - (NSValue*)selectedTextRange { +@@ -2029,6 +2039,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -109,7 +109,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -2061,6 +2072,7 @@ - (id)selectedTextMarkerRange { +@@ -2061,6 +2072,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; anchorAffinity, *focusObject, focusOffset, focusAffinity)); } @@ -117,7 +117,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSValue*)size { if (![self instanceActive]) -@@ -2093,6 +2105,7 @@ - (NSString*)sortDirection { +@@ -2093,6 +2105,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -125,7 +125,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2103,6 +2116,7 @@ - (id)startTextMarker { +@@ -2103,6 +2116,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfAnchor()); } @@ -133,7 +133,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a subrole based upon the role. - (NSString*) subrole { -@@ -2405,12 +2419,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { +@@ -2405,12 +2419,14 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; NSMutableAttributedString* attributedValue = [[[NSMutableAttributedString alloc] initWithString:value] autorelease]; @@ -148,7 +148,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 return [attributedValue attributedSubstringFromRange:range]; } -@@ -2527,6 +2543,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2527,6 +2543,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -156,7 +156,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) { BrowserAccessibilityPositionInstance position = CreatePositionFromTextMarker(parameter); -@@ -2704,6 +2721,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2704,6 +2721,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; NSString* text = GetTextForTextMarkerRange(parameter); return [NSNumber numberWithInt:[text length]]; } @@ -164,7 +164,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -2741,6 +2759,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2741,6 +2759,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -172,7 +172,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { BrowserAccessibilityPositionInstance position = -@@ -2820,6 +2839,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( +@@ -2820,6 +2839,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return @(child->GetIndexInParent()); } @@ -184,7 +184,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f8b059397 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -437,6 +437,7 @@ +@@ -437,6 +437,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: [user_info setObject:native_focus_object forKey:NSAccessibilityTextChangeElement]; @@ -192,7 +192,7 @@ index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f id selected_text = [native_focus_object selectedTextMarkerRange]; if (selected_text) { NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute = -@@ -444,6 +445,7 @@ +@@ -444,6 +445,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: [user_info setObject:selected_text forKey:NSAccessibilitySelectedTextMarkerRangeAttribute]; } @@ -220,7 +220,7 @@ index 1e2cc38d3868ceccf8e45f5f82f57bcaa478f982..daa934c345e2686fd2174b7721d0f69a namespace content { -@@ -38,6 +40,7 @@ void _LSSetApplicationLaunchServicesServerConnectionStatus( +@@ -38,6 +40,7 @@ namespace { // This disconnects from the window server, and then indicates that Chrome // should continue execution without access to launchservicesd. void DisconnectWindowServer() { @@ -248,7 +248,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -47,6 +48,7 @@ +@@ -47,6 +48,7 @@ extern "C" { // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -256,7 +256,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 namespace { -@@ -120,8 +122,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -120,8 +122,10 @@ BluetoothAdapterMac::BluetoothAdapterMac() controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -267,7 +267,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 should_update_name_(true), classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), -@@ -314,8 +318,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -314,8 +318,12 @@ bool BluetoothAdapterMac::IsLowEnergyAvailable() { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { diff --git a/patches/common/chromium/render_widget_host_view_mac.patch b/patches/common/chromium/render_widget_host_view_mac.patch index 5d3b87d43d0e5..78998124eb60c 100644 --- a/patches/common/chromium/render_widget_host_view_mac.patch +++ b/patches/common/chromium/render_widget_host_view_mac.patch @@ -20,7 +20,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -354,6 +359,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -354,6 +359,9 @@ void ExtractUnderlines(NSAttributedString* string, } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -30,7 +30,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 return [self acceptsMouseEventsWhenInactive]; } -@@ -688,6 +696,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -688,6 +696,10 @@ void ExtractUnderlines(NSAttributedString* string, eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -41,7 +41,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { localClient_->ForwardKeyboardEvent(event, latency_info); -@@ -1460,9 +1472,11 @@ - (id)accessibilityFocusedUIElement { +@@ -1460,9 +1472,11 @@ void ExtractUnderlines(NSAttributedString* string, // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -53,7 +53,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1471,7 +1485,10 @@ - (NSArray*)validAttributesForMarkedText { +@@ -1471,7 +1485,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName; initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, diff --git a/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch b/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch new file mode 100644 index 0000000000000..711291929414d --- /dev/null +++ b/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lan Wei +Date: Wed, 12 Sep 2018 00:36:53 +0000 +Subject: Setup the observer before calling DisplayVirtualKeyboard + +This is a follow up CL of +https://chromium-review.googlesource.com/c/chromium/src/+/1194406 + +We should setup the keyboard observer before displaying the virtual +keyboard otherwise the observer won't see the change of the virtual +keyboard. + +Bug: 871756 +Change-Id: I6b13072ed06d9e10d188c553082b411f2bb09326 +Reviewed-on: https://chromium-review.googlesource.com/1220560 +Reviewed-by: Sadrul Chowdhury +Commit-Queue: Lan Wei +Cr-Commit-Position: refs/heads/master@{#590553} + +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index de9490d94d98afa6812e81b0cf50fb4adc81887c..a1ae227501930e918ea87d2013f6c300fd83644d 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -756,10 +756,12 @@ void RenderWidgetHostViewAura::FocusedNodeTouched(bool editable) { + return; + auto* controller = input_method->GetInputMethodKeyboardController(); + if (editable && host()->GetView() && host()->delegate()) { +- keyboard_observer_.reset(nullptr); +- if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH && +- controller->DisplayVirtualKeyboard()) { ++ if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH) { + keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); ++ if (!controller->DisplayVirtualKeyboard()) ++ keyboard_observer_.reset(nullptr); ++ } else { ++ keyboard_observer_.reset(nullptr); + } + virtual_keyboard_requested_ = keyboard_observer_.get(); + } else { diff --git a/patches/common/chromium/tabbed_window_lagging.patch b/patches/common/chromium/tabbed_window_lagging.patch index 1538624675ac3..ddb29ec569366 100644 --- a/patches/common/chromium/tabbed_window_lagging.patch +++ b/patches/common/chromium/tabbed_window_lagging.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao -Date: Thu May 16 13:52:12 JST 2019 +Date: Thu, 16 May 2019 13:52:12 +0900 Subject: tabbed_window_lagging.patch Fix lagging when using tabbed windows. @@ -12,10 +12,10 @@ we can not just cherry-pick them. Instead I'm just using the dummy fix and it does not seem to have side effects. diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm -index 69c5f1f44d7e..45aba19b2390 100644 +index 8841b59f6b70ac4687adfde61a1fba1424e57e48..cc3659319c4076043a0493798db3c7b8a4afd21e 100644 --- a/ui/views/cocoa/bridged_native_widget.mm +++ b/ui/views/cocoa/bridged_native_widget.mm -@@ -1037,6 +1037,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -1039,6 +1039,12 @@ bool BridgedNativeWidget::ShouldRunCustomAnimationFor( // BridgedNativeWidget, ui::CATransactionObserver bool BridgedNativeWidget::ShouldWaitInPreCommit() { diff --git a/patches/common/chromium/webview_cross_drag.patch b/patches/common/chromium/webview_cross_drag.patch index 762e30a083c32..2594a6d429b16 100644 --- a/patches/common/chromium/webview_cross_drag.patch +++ b/patches/common/chromium/webview_cross_drag.patch @@ -20,7 +20,7 @@ diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser index cec3bd8a97b8b9bcab176a9bd2c296ec12aba838..7a2b4462bd44176e8e8389499f8c3d5fea647fa0 100644 --- a/content/browser/web_contents/web_drag_dest_mac.mm +++ b/content/browser/web_contents/web_drag_dest_mac.mm -@@ -348,6 +348,7 @@ - (void)setDragStartTrackersForProcess:(int)processID { +@@ -348,6 +348,7 @@ GetRenderWidgetHostAtPoint:(const NSPoint&)viewPoint } - (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {