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

Unified Diff: cc/blink/web_layer_impl.cc

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Addressed the easier reviewer comments. Created 3 years, 9 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/BUILD.gn ('k') | cc/layers/layer.cc » ('j') | cc/trees/property_tree.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_layer_impl.cc
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 43d7caa7f202b524f31c1b004f3600d19d70183b..4f9a02acf2b1d70430e80d112efdbfc4f97009c8 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -378,6 +378,9 @@ ToWebLayerStickyPositionConstraint(
constraint.scroll_container_relative_sticky_box_rect;
web_constraint.scrollContainerRelativeContainingBlockRect =
constraint.scroll_container_relative_containing_block_rect;
+ // TODO(smcgruer): Copy over ancestor pointers, or use layer ids.
+ web_constraint.localStickyOffset =
+ blink::WebFloatSize(constraint.local_sticky_offset);
return web_constraint;
}
static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
@@ -398,6 +401,15 @@ static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
web_constraint.scrollContainerRelativeStickyBoxRect;
constraint.scroll_container_relative_containing_block_rect =
web_constraint.scrollContainerRelativeContainingBlockRect;
+ constraint.nearest_layer_shifting_sticky_box =
+ web_constraint.nearestLayerShiftingStickyBox
+ ? web_constraint.nearestLayerShiftingStickyBox->ccLayer()
+ : nullptr;
+ constraint.nearest_layer_shifting_containing_block =
+ web_constraint.nearestLayerShiftingContainingBlock
+ ? web_constraint.nearestLayerShiftingContainingBlock->ccLayer()
+ : nullptr;
+ constraint.local_sticky_offset = web_constraint.localStickyOffset;
return constraint;
}
void WebLayerImpl::setStickyPositionConstraint(
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/layer.cc » ('j') | cc/trees/property_tree.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698