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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2929873002: Shifting layer position for sticky element to avoid passing unnessary variable to cc (Closed)
Patch Set: Created 3 years, 6 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 ff0a6cc91c409377a81421178cd8ecf2ef78e699..93ffd62e8914238d957ae389d876191b70ae4289 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -6865,7 +6865,6 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionMainThreadUpdates) {
sticky_position.scroll_container_relative_containing_block_rect =
gfx::Rect(0, 0, 50, 50);
sticky_pos->SetStickyPositionConstraint(sticky_position);
- sticky_pos->SetElementId(LayerIdToElementIdForTesting(sticky_pos->id()));
root->SetBounds(gfx::Size(100, 100));
container->SetBounds(gfx::Size(100, 100));
@@ -6905,8 +6904,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionMainThreadUpdates) {
// Now the main thread commits the new position of the sticky element.
scroller->SetScrollOffset(gfx::ScrollOffset(15, 15));
- sticky_pos->SetPosition(gfx::PointF(10, 25));
- sticky_pos->SetOffsetForStickyPositionFromMainThread(gfx::Size(0, 5));
+ // Shift the layer by -offset_for_position_sticky.
+ sticky_pos->SetPosition(gfx::PointF(10, 25) - gfx::Vector2dF(0, 5));
ExecuteCalculateDrawProperties(root.get());
host()->host_impl()->CreatePendingTree();
host()->CommitAndCreatePendingTree();
@@ -6958,7 +6957,6 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
sticky_position.scroll_container_relative_containing_block_rect =
gfx::Rect(20, 20, 30, 30);
sticky_pos->SetStickyPositionConstraint(sticky_position);
- sticky_pos->SetElementId(LayerIdToElementIdForTesting(sticky_pos->id()));
root->SetBounds(gfx::Size(100, 100));
container->SetBounds(gfx::Size(100, 100));
@@ -7000,8 +6998,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
// Now the main thread commits the new position of the sticky element.
scroller->SetScrollOffset(gfx::ScrollOffset(0, 25));
- sticky_pos->SetPosition(gfx::PointF(0, 15));
- sticky_pos->SetOffsetForStickyPositionFromMainThread(gfx::Size(0, 5));
+ // Shift the layer by -offset_for_position_sticky.
+ sticky_pos->SetPosition(gfx::PointF(0, 15) - gfx::Vector2dF(0, 5));
ExecuteCalculateDrawProperties(root.get());
host()->host_impl()->CreatePendingTree();
host()->CommitAndCreatePendingTree();

Powered by Google App Engine
This is Rietveld 408576698