Chromium Code Reviews| 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 685cfb99122f393eec5b610e90c35c8c51ed546d..eced362eacae6b604634276c36354246437b80c1 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -2313,6 +2313,20 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, |
| unused_root_delta.set_x(0.0f); |
| if (std::abs(unused_root_delta.y()) < kEpsilon) |
| unused_root_delta.set_y(0.0f); |
| + // Disable overscroll on axes which is impossible to scroll. |
| + if (settings_.report_overscroll_only_for_scrollable_axes) { |
| + gfx::SizeF ceiled_viewport_size = |
|
jdduke (slow)
2014/04/10 14:16:02
You shouldn't need to check both viewport size and
|
| + gfx::ToCeiledSize(active_tree_->ScrollableViewportSize()); |
| + gfx::SizeF root_layer_size = active_tree_->ScrollableSize(); |
| + if (!(ceiled_viewport_size.width() < root_layer_size.width())) { |
| + if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().x()) <= 0) |
|
aelias_OOO_until_Jul13
2014/04/10 16:28:37
Please also check OuterViewportScrollLayer as I me
|
| + unused_root_delta.set_x(0.0f); |
| + } |
| + if (!(ceiled_viewport_size.height() < root_layer_size.height())) { |
| + if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().y()) <= 0) |
| + unused_root_delta.set_y(0.0f); |
| + } |
| + } |
| } |
| // If the layer wasn't able to move, try the next one in the hierarchy. |