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

Unified Diff: cc/trees/property_tree.cc

Issue 2890583002: Fix incorrect use of coords conversion for sticky elements (Closed)
Patch Set: nit Created 3 years, 7 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 | « no previous file | third_party/WebKit/LayoutTests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index f450baa7067a5b3aa83fa9b6f08a201f17eb2e24..78383127b48bd8e2138b6047a60e78b41cdd3140 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -457,8 +457,10 @@ 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 -
- sticky_box_rect.OffsetFromOrigin();
+ return sticky_offset - layer_offset - sticky_box_rect.OffsetFromOrigin() -
+ ((node->source_node_id != node->parent_id)
+ ? node->source_offset + node->source_to_parent
+ : gfx::Vector2dF());
}
void TransformTree::UpdateLocalTransform(TransformNode* node) {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698