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

Unified Diff: cc/trees/property_tree.cc

Issue 2911463002: Unify the calculation of main thread offset of sticky element (Closed)
Patch Set: nit 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/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index a64099b265b3723cf97ea2380650c6135193b0dd..89445a11614dd5ab436c31da70fd39eeeb3ed227 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -378,7 +378,6 @@ gfx::Vector2dF StickyPositionOffset(TransformTree* tree, TransformNode* node) {
scroll_position,
gfx::SizeF(property_trees.scroll_tree.scroll_clip_layer_bounds(
scroll_node->id)));
- gfx::Vector2dF layer_offset(sticky_data->main_thread_offset);
gfx::Vector2dF ancestor_sticky_box_offset;
if (sticky_data->nearest_node_shifting_sticky_box !=
@@ -463,7 +462,7 @@ gfx::Vector2dF StickyPositionOffset(TransformTree* tree, TransformNode* node) {
ancestor_sticky_box_offset + ancestor_containing_block_offset +
sticky_offset - sticky_box_rect.OffsetFromOrigin();
- return sticky_offset - layer_offset - node->source_to_parent -
+ return sticky_offset - node->sticky_main_thread_offset -
sticky_box_rect.OffsetFromOrigin();
trchen 2017/06/05 22:43:11 This is quite confusing. I think the logic is to c
yigu 2017/06/06 19:33:18 Done.
}

Powered by Google App Engine
This is Rietveld 408576698