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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 14221010: Make LayerTreeImpl::ScrollableArea more robust (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with a test. Created 7 years, 8 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_unittest_scroll.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 eadc4043ab43621b06a0cc02fd7f4d000651856b..c24e314f06b29946987f884639684d1213de3673 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -358,9 +358,14 @@ const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const {
}
gfx::Size LayerTreeImpl::ScrollableSize() const {
- if (!root_scroll_layer_ || root_scroll_layer_->children().empty())
+ if (!root_scroll_layer_)
return gfx::Size();
- return root_scroll_layer_->children()[0]->bounds();
+
+ gfx::Size scrollable_size;
+ for (size_t i = 0; i < root_scroll_layer_->children().size(); ++i)
+ scrollable_size.ClampToMin(root_scroll_layer_->children()[i]->bounds());
+
+ return scrollable_size;
}
LayerImpl* LayerTreeImpl::LayerById(int id) {
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698