Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 18202006: Make scrollable viewport size no longer depend on clip layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECK(IsActiveTree()) on RootScrollLayer Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698