| 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) {
|
|
|