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

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: Apply to MaxScrollOffset 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
« no previous file with comments | « 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..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());
« no previous file with comments | « 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