Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2740133002: Mark sub-frame root layer non-fast scrollable when wheel handlers present. (Closed)
Patch Set: Add mainframe version of test for verification. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/test/data/page_with_scrollable_div.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 478ebec86d56cf2317f350919ac112654602ec3d..4f62426e643ac05260df6747cc910aa9db744ef6 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -829,7 +829,7 @@ void RenderWidgetCompositor::setEventListenerProperties(
static_cast<cc::EventListenerProperties>(properties));
}
-void RenderWidgetCompositor::updateTouchRectsForSubframeIfNecessary() {
+void RenderWidgetCompositor::updateEventRectsForSubframeIfNecessary() {
if (!is_for_oopif_)
return;
@@ -841,9 +841,9 @@ void RenderWidgetCompositor::updateTouchRectsForSubframeIfNecessary() {
using blink::WebEventListenerProperties;
using blink::WebEventListenerClass;
- blink::WebEventListenerProperties touch_start_properties =
+ WebEventListenerProperties touch_start_properties =
eventListenerProperties(WebEventListenerClass::TouchStartOrMove);
- blink::WebEventListenerProperties touch_end_cancel_properties =
+ WebEventListenerProperties touch_end_cancel_properties =
eventListenerProperties(WebEventListenerClass::TouchEndOrCancel);
bool has_touch_handlers =
touch_start_properties == WebEventListenerProperties::Blocking ||
@@ -853,11 +853,22 @@ void RenderWidgetCompositor::updateTouchRectsForSubframeIfNecessary() {
touch_end_cancel_properties ==
WebEventListenerProperties::BlockingAndPassive;
+ WebEventListenerProperties wheel_event_properties =
+ eventListenerProperties(WebEventListenerClass::MouseWheel);
+ bool has_wheel_handlers =
+ wheel_event_properties == WebEventListenerProperties::Blocking ||
+ wheel_event_properties == WebEventListenerProperties::BlockingAndPassive;
+
cc::Layer* root_layer = layer_tree_host_->root_layer();
cc::Region touch_handler_region;
if (has_touch_handlers)
touch_handler_region = gfx::Rect(gfx::Point(), root_layer->bounds());
root_layer->SetTouchEventHandlerRegion(touch_handler_region);
+
+ cc::Region wheel_handler_region;
+ if (has_wheel_handlers)
+ wheel_handler_region = gfx::Rect(gfx::Point(), root_layer->bounds());
+ root_layer->SetNonFastScrollableRegion(wheel_handler_region);
}
blink::WebEventListenerProperties
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/test/data/page_with_scrollable_div.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698