| 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 2e5b954ba3853611a1ca9b042aa394ca5c45c49b..95307c4dc154b1d95f17e28dc5822f6e6435024d 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -2957,6 +2957,7 @@ void LayerTreeHostImpl::ApplyScroll(ScrollNode* scroll_node,
|
| // we want to scroll the inner viewport -- to allow panning while zoomed --
|
| // but also move browser controls if needed.
|
| bool is_inner_viewport_scroll_layer =
|
| + InnerViewportScrollLayer() &&
|
| scroll_node->owner_id == InnerViewportScrollLayer()->id();
|
|
|
| if (is_viewport_scroll_layer || is_inner_viewport_scroll_layer) {
|
| @@ -3051,6 +3052,21 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
|
| DCHECK(scroll_state);
|
|
|
| TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy");
|
| +
|
| + if (!CurrentlyScrollingLayer()) {
|
| + // If the InputHandlerClient didn't call ScrollBegin() to re-perform a
|
| + // hit-test but provided an element to scroll instead, scroll that.
|
| + ElementId provided_element =
|
| + scroll_state->data()->current_native_scrolling_element();
|
| + if (provided_element) {
|
| + // Assume the primaryId matches the layer_id for lookup (this is true for
|
| + // ui:Layers), then check the match.
|
| + LayerImpl* layer = active_tree()->LayerById(provided_element.primaryId);
|
| + if (layer && layer->element_id() == provided_element)
|
| + active_tree_->SetCurrentlyScrollingLayer(layer);
|
| + }
|
| + }
|
| +
|
| if (!CurrentlyScrollingLayer())
|
| return InputHandlerScrollResult();
|
|
|
|
|