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

Unified Diff: cc/blink/web_layer_impl.cc

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: Rebase 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
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/layer.cc » ('j') | no next file with comments »
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..d92a7285a42665b9451139d18495d1c581ce0ab7 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 too.
+ web_constraint.cachedComputedStickyOffset =
+ blink::WebFloatSize(constraint.cached_computed_sticky_offset);
return web_constraint;
}
static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
@@ -398,6 +401,16 @@ 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.cached_computed_sticky_offset =
+ web_constraint.cachedComputedStickyOffset;
return constraint;
}
void WebLayerImpl::setStickyPositionConstraint(
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698