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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2698843004: Correct for enclosing layers scroll position in sticky_data->main_thread_offset (Closed)
Patch Set: Created 3 years, 10 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
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 969398354c27a08fbe0a5efc614eac2302d1ede4..4b76c2f960e49ef0553e92f57ae40988a382416d 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -7651,7 +7651,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionMainThreadUpdates) {
// This tests the main thread updates with a composited sticky container. In
// this case the position received from main is relative to the container but
-// the constraint rects are relative to the ancestor scroller.
+// the constraint rects are relative to the ancestor scroller. The
+// parent_relative_sticky_box_offset from main also includes the scroll offset.
TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<Layer> container = Layer::Create();
@@ -7719,6 +7720,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
// Now the main thread commits the new position of the sticky element.
scroller->SetScrollOffset(gfx::ScrollOffset(0, 25));
+ sticky_position.parent_relative_sticky_box_offset += gfx::Vector2d(0, 25);
+ sticky_pos->SetStickyPositionConstraint(sticky_position);
sticky_pos->SetPosition(gfx::PointF(0, 15));
ExecuteCalculateDrawProperties(root.get());
host()->host_impl()->CreatePendingTree();
« cc/layers/layer.cc ('K') | « cc/layers/layer.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698