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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 22567004: Ignore should-scroll-on-main-thread if main frame is not scrollable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 7d02db56c019a1893502f3e71f3dbcbb98e0b9ba..1f19e9c496e16747743ac21534e080b3a61f046d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1807,6 +1807,16 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
LayerImpl* layer_impl = LayerTreeHostCommon::FindLayerThatIsHitByPoint(
device_viewport_point, active_tree_->RenderSurfaceLayerList());
+ LayerImpl* root_scroll_layer =
+ LayerTreeHostCommon::FindFirstScrollableLayer(
+ active_tree_->root_layer());
+
+ bool main_frame_is_scrollable =
+ root_scroll_layer &&
+ root_scroll_layer->scrollable() &&
+ (root_scroll_layer->max_scroll_offset().x() != 0 ||
+ root_scroll_layer->max_scroll_offset().y() != 0);
+
// Walk up the hierarchy and look for a scrollable layer.
LayerImpl* potentially_scrolling_layer_impl = 0;
@@ -1815,10 +1825,11 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
"impl-scroll", "LayerTreeHostImpl::ScrollBegin considering layer",
TRACE_EVENT_SCOPE_THREAD,
"layer_id", layer_impl->id());
-
// The content layer can also block attempts to scroll outside the main
// thread.
- ScrollStatus status = layer_impl->TryScroll(device_viewport_point, type);
+ ScrollStatus status = layer_impl->TryScroll(device_viewport_point,
+ type,
+ main_frame_is_scrollable);
if (status == ScrollOnMainThread) {
rendering_stats_instrumentation_->IncrementMainThreadScrolls();
TRACE_EVENT_INSTANT0(
@@ -1840,7 +1851,9 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
TRACE_EVENT_SCOPE_THREAD,
"layer_id", scroll_layer_impl->id());
- status = scroll_layer_impl->TryScroll(device_viewport_point, type);
+ status = scroll_layer_impl->TryScroll(device_viewport_point,
+ type,
+ main_frame_is_scrollable);
// If any layer wants to divert the scroll event to the main thread, abort.
if (status == ScrollOnMainThread) {
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698