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 613093e8041bef8ff4eaa4fe55d41e2a39de7da6..f79f47bdf085258bf53a319a915e99bc96d85178 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -3012,6 +3012,7 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( |
MainThreadScrollingReason::kNotScrollingOnMain; |
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
+ bool x_dominated = (std::abs(scroll_delta.x()) > std::abs(scroll_delta.y())); |
if (scroll_node) { |
// Flash the overlay scrollbar even if the scroll dalta is 0. |
@@ -3091,6 +3092,14 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( |
} |
pending_delta -= scroll_delta; |
+ |
+ if ((x_dominated && |
+ scroll_node->scroll_boundary_behavior.x != |
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) || |
+ (!x_dominated && |
+ scroll_node->scroll_boundary_behavior.y != |
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto)) |
+ break; |
} |
} |
scroll_state.set_is_ending(true); |
@@ -3298,6 +3307,8 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { |
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
ScrollNode* viewport_scroll_node = OuterViewportScrollNode(); |
+ bool x_dominated = |
+ (std::abs(scroll_state->delta_x()) > std::abs(scroll_state->delta_y())); |
if (scroll_node) { |
// TODO(bokan): The loop checks for a null parent but don't we still want to |
// distribute to the root scroll node? |
@@ -3312,10 +3323,16 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { |
break; |
} |
- if (!scroll_node->scrollable) |
- continue; |
+ if (scroll_node->scrollable) |
+ current_scroll_chain.push_front(scroll_node); |
- current_scroll_chain.push_front(scroll_node); |
+ if ((x_dominated && |
+ scroll_node->scroll_boundary_behavior.x != |
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) || |
+ (!x_dominated && |
+ scroll_node->scroll_boundary_behavior.y != |
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto)) |
+ break; |
} |
} |
scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, |