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..42eb86f1d0bcc2a4b8f2ed0899d99977bfe606c1 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_; |
| } |
| @@ -306,9 +305,22 @@ const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
| } |
| gfx::Size LayerTreeImpl::ScrollableSize() const { |
| - if (!root_scroll_layer_ || root_scroll_layer_->children().empty()) |
| + LayerImpl* root_scroll = RootScrollLayer(); |
| + if (!root_scroll || root_scroll->children().empty()) |
| return gfx::Size(); |
| - return root_scroll_layer_->children()[0]->bounds(); |
| + gfx::Size content_size = root_scroll->children()[0]->bounds(); |
| + |
| + // For the purposes of scrolling, non-overlay scrollbars are considered to |
|
enne (OOO)
2013/07/12 17:19:27
This code looks a bit suspicious to me and I need
aelias_OOO_until_Jul13
2013/07/12 18:18:23
Note that this code is adding to the scrollable si
enne (OOO)
2013/07/12 18:30:27
I don't think the scroll layer size is at all rela
|
| + // occupy a placeholder area on the right and bottom of the document, instead |
| + // of shrinking the viewport size. |
| + ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer(); |
| + ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer(); |
| + if (horiz && !horiz->is_overlay_scrollbar()) |
| + content_size.set_height(content_size.height() + horiz->thumb_thickness()); |
| + if (vertical && !vertical->is_overlay_scrollbar()) |
| + content_size.set_width(content_size.width() + vertical->thumb_thickness()); |
| + |
| + return content_size; |
| } |
| LayerImpl* LayerTreeImpl::LayerById(int id) { |