cef/patch/patches/webkit_popups.patch

77 lines
3.7 KiB
Diff
Raw Normal View History

diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h
index db7d7c87686a..a7c6beb6a6f1 100644
--- third_party/blink/public/web/web_view.h
+++ third_party/blink/public/web/web_view.h
@@ -366,6 +366,7 @@ class WebView {
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void SetUseExternalPopupMenus(bool);
+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0;
// Cancels and hides the current popup (datetime, select...) if any.
virtual void CancelPagePopup() = 0;
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
index 58e4fbcf6ee2..51f2645e6154 100644
--- third_party/blink/renderer/core/exported/web_view_impl.cc
+++ third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -219,8 +219,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) {
g_should_use_external_popup_menus = use_external_popup_menus;
}
-bool WebViewImpl::UseExternalPopupMenus() {
- return g_should_use_external_popup_menus;
+void WebViewImpl::SetUseExternalPopupMenusThisInstance(
+ bool use_external_popup_menus) {
+ should_use_external_popup_menus_ = use_external_popup_menus;
+}
+
+bool WebViewImpl::UseExternalPopupMenus() const {
+ return should_use_external_popup_menus_;
}
Implement off-screen rendering support using delegated rendering (issue #1257). This implementation supports both GPU compositing and software compositing (used when GPU is not supported or when passing `--disable-gpu --disable-gpu-compositing` command-line flags). GPU-accelerated features (WebGL and 3D CSS) that did not work with the previous off-screen rendering implementation do work with this implementation when GPU support is available. Rendering now operates on a per-frame basis. The frame rate is configurable via CefBrowserSettings.windowless_frame_rate up to a maximum of 60fps (potentially limited by how fast the system can generate new frames). CEF generates a bitmap from the compositor backing and passes it to CefRenderHandler::OnPaint. The previous CefRenderHandler/CefBrowserHost API for off-screen rendering has been restored mostly as-is with some minor changes: - CefBrowserHost::Invalidate no longer accepts a CefRect region argument. Instead of invalidating a specific region it now triggers generation of a new frame. - The |dirtyRects| argument to CefRenderHandler::OnPaint will now always be a single CefRect representing the whole view (frame) size. Previously, invalidated regions were listed separately. - Linux: CefBrowserHost::SendKeyEvent now expects X11 event information instead of GTK event information. See cefclient for an example of converting GTK events to the necessary format. - Sizes passed to the CefRenderHandler OnPaint and OnPopupSize methods are now already DPI scaled. Previously, the client had to perform DPI scaling. - Includes drag&drop implementation from issue #1032. - Includes unit test fixes from issue #1245. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-01 00:30:29 +02:00
namespace {
@@ -278,6 +283,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
chrome_client_(MakeGarbageCollected<ChromeClientImpl>(this)),
minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)),
maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)),
+ should_use_external_popup_menus_(g_should_use_external_popup_menus),
does_composite_(does_composite),
fullscreen_controller_(std::make_unique<FullscreenController>(this)) {
if (!AsView().client) {
diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
index 61d54c30b50c..d08ad65454ac 100644
--- third_party/blink/renderer/core/exported/web_view_impl.h
+++ third_party/blink/renderer/core/exported/web_view_impl.h
@@ -115,7 +115,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
static HashSet<WebViewImpl*>& AllInstances();
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool UseExternalPopupMenus();
+ void SetUseExternalPopupMenusThisInstance(bool) override;
+ bool UseExternalPopupMenus() const;
Implement off-screen rendering support using delegated rendering (issue #1257). This implementation supports both GPU compositing and software compositing (used when GPU is not supported or when passing `--disable-gpu --disable-gpu-compositing` command-line flags). GPU-accelerated features (WebGL and 3D CSS) that did not work with the previous off-screen rendering implementation do work with this implementation when GPU support is available. Rendering now operates on a per-frame basis. The frame rate is configurable via CefBrowserSettings.windowless_frame_rate up to a maximum of 60fps (potentially limited by how fast the system can generate new frames). CEF generates a bitmap from the compositor backing and passes it to CefRenderHandler::OnPaint. The previous CefRenderHandler/CefBrowserHost API for off-screen rendering has been restored mostly as-is with some minor changes: - CefBrowserHost::Invalidate no longer accepts a CefRect region argument. Instead of invalidating a specific region it now triggers generation of a new frame. - The |dirtyRects| argument to CefRenderHandler::OnPaint will now always be a single CefRect representing the whole view (frame) size. Previously, invalidated regions were listed separately. - Linux: CefBrowserHost::SendKeyEvent now expects X11 event information instead of GTK event information. See cefclient for an example of converting GTK events to the necessary format. - Sizes passed to the CefRenderHandler OnPaint and OnPopupSize methods are now already DPI scaled. Previously, the client had to perform DPI scaling. - Includes drag&drop implementation from issue #1032. - Includes unit test fixes from issue #1245. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-01 00:30:29 +02:00
// Returns whether frames under this WebView are backed by a compositor.
bool does_composite() const { return does_composite_; }
@@ -617,6 +618,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
float fake_page_scale_animation_page_scale_factor_ = 0.f;
bool fake_page_scale_animation_use_anchor_ = false;
+ bool should_use_external_popup_menus_;
Implement off-screen rendering support using delegated rendering (issue #1257). This implementation supports both GPU compositing and software compositing (used when GPU is not supported or when passing `--disable-gpu --disable-gpu-compositing` command-line flags). GPU-accelerated features (WebGL and 3D CSS) that did not work with the previous off-screen rendering implementation do work with this implementation when GPU support is available. Rendering now operates on a per-frame basis. The frame rate is configurable via CefBrowserSettings.windowless_frame_rate up to a maximum of 60fps (potentially limited by how fast the system can generate new frames). CEF generates a bitmap from the compositor backing and passes it to CefRenderHandler::OnPaint. The previous CefRenderHandler/CefBrowserHost API for off-screen rendering has been restored mostly as-is with some minor changes: - CefBrowserHost::Invalidate no longer accepts a CefRect region argument. Instead of invalidating a specific region it now triggers generation of a new frame. - The |dirtyRects| argument to CefRenderHandler::OnPaint will now always be a single CefRect representing the whole view (frame) size. Previously, invalidated regions were listed separately. - Linux: CefBrowserHost::SendKeyEvent now expects X11 event information instead of GTK event information. See cefclient for an example of converting GTK events to the necessary format. - Sizes passed to the CefRenderHandler OnPaint and OnPopupSize methods are now already DPI scaled. Previously, the client had to perform DPI scaling. - Includes drag&drop implementation from issue #1032. - Includes unit test fixes from issue #1245. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-01 00:30:29 +02:00
+
float compositor_device_scale_factor_override_ = 0.f;
TransformationMatrix device_emulation_transform_;
diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
index 6d90e9c8e0be..b9e56a2f48e5 100644
--- third_party/blink/renderer/core/page/chrome_client_impl.cc
+++ third_party/blink/renderer/core/page/chrome_client_impl.cc
@@ -856,7 +856,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
NotifyPopupOpeningObservers();
- if (WebViewImpl::UseExternalPopupMenus())
+ if (web_view_->UseExternalPopupMenus())
return MakeGarbageCollected<ExternalPopupMenu>(frame, select);
DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());