Chromium Code Reviews| Index: cc/trees/layer_tree_impl.cc |
| diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
| index 25cd58a6bf26c695d6bae75db99f1ee2fe0a7afc..e5aef8a3034275739d50627a4a20be43114ed1d2 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -136,7 +136,6 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
| } |
| LayerImpl* LayerTreeImpl::RootScrollLayer() const { |
| - DCHECK(IsActiveTree()); |
| return root_scroll_layer_; |
| } |
| @@ -209,12 +208,22 @@ gfx::SizeF LayerTreeImpl::ScrollableViewportSize() const { |
| } |
| void LayerTreeImpl::UpdateMaxScrollOffset() { |
| - if (!root_scroll_layer_ || !root_scroll_layer_->children().size()) |
| + LayerImpl* root_scroll = RootScrollLayer(); |
| + if (!root_scroll || !root_scroll->children().size()) |
| return; |
| gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - |
| gfx::RectF(ScrollableViewportSize()).bottom_right(); |
| + // The scrollable viewport size is based on device viewport instead of Blink's |
| + // container layer, so we need to adjust for non-overlay scrollbars. |
| + ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer(); |
| + ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer(); |
| + if (horiz && !horiz->is_overlay_scrollbar()) |
| + max_scroll.set_y(max_scroll.y() + horiz->thumb_thickness()); |
|
enne (OOO)
2013/07/12 23:48:05
I still don't really understand this. You can scr
enne (OOO)
2013/07/12 23:50:30
Eh, sorry, misreading code late on a Friday.
I gu
|
| + if (vertical && !vertical->is_overlay_scrollbar()) |
| + max_scroll.set_x(max_scroll.x() + vertical->thumb_thickness()); |
| + |
| // The viewport may be larger than the contents in some cases, such as |
| // having a vertical scrollbar but no horizontal overflow. |
| max_scroll.SetToMax(gfx::Vector2dF()); |