From e91e3894e6c34cc0ffe69ed45417c0ebec882fb1 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 9 Jun 2025 17:56:33 -0400 Subject: [PATCH] revert Don't use static variable for UseExternalPopupMenus --- .../extend_apply_webpreferences.patch | 22 +++++++++++-------- ...moothing_css_rule_and_blink_painting.patch | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index a19b96955c..36729a582c 100644 --- a/patches/chromium/extend_apply_webpreferences.patch +++ b/patches/chromium/extend_apply_webpreferences.patch @@ -3,11 +3,8 @@ From: Samuel Attard Date: Mon, 8 Mar 2021 16:27:39 -0800 Subject: extend ApplyWebPreferences with Electron-specific logic -On macOS, popup menus are rendered by the main process by default. -This causes problems in OSR, since when the popup is rendered separately, -it won't be captured in the rendered image. -Offscreen can be updated at runtime, as such we need to apply the -turn on/off ExternalPopupMenu in the ApplyPreferences method. +background_color can be updated at runtime, as such we need to apply the +new background color to the WebView in the ApplyPreferences method. There is no current way to attach an observer to these prefs so patching is our only option. @@ -15,15 +12,22 @@ Ideally we could add an embedder observer pattern here but that can be done in future work. diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index 2390395a3df10aca3510a619e91dab674de60e67..40d67cfda7740a5c1c0ed811fa71681a36f09fce 100644 +index 2390395a3df10aca3510a619e91dab674de60e67..f8fae134e122a223440530bd696db899dce2fe56 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -1864,6 +1864,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -172,6 +172,7 @@ + #include "third_party/blink/renderer/core/view_transition/view_transition_supplement.h" + #include "third_party/blink/renderer/platform/fonts/font_cache.h" + #include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h" ++#include "third_party/blink/renderer/platform/graphics/color.h" + #include "third_party/blink/renderer/platform/graphics/image.h" + #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h" + #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h" +@@ -1864,6 +1865,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, #if BUILDFLAG(IS_MAC) web_view_impl->SetMaximumLegibleScale( prefs.default_maximum_page_scale_factor); -+ web_view_impl->GetChromeClient().SetUseExternalPopupMenusForTesting( -+ !prefs.offscreen); ++ SetUseExternalPopupMenus(!prefs.offscreen); #endif #if BUILDFLAG(IS_WIN) diff --git a/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch b/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch index e47d584b4e..9811e3b83f 100644 --- a/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch +++ b/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch @@ -241,7 +241,7 @@ index aa8b248b94ea7f6c0e04dc66e976dc7923ff3a98..868630ed2adb8f40fb7f002d45b260c0 bool RenderVSyncNotificationEnabled() const { return render_v_sync_notification_enabled_; diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index 40d67cfda7740a5c1c0ed811fa71681a36f09fce..0672068891793403b6674533f8fc6fce58b43ac9 100644 +index f8fae134e122a223440530bd696db899dce2fe56..cec68a428fbf63932066ceb296c3db3eb9e34166 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -3579,6 +3579,9 @@ void WebViewImpl::UpdateRendererPreferences(