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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2401903002: Compute and include the offset of the sticky box to its enclosing composited layer. (Closed)
Patch Set: Merge with master and fix long line. Created 4 years, 2 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/trees/property_tree_builder.cc ('k') | third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index ff4963bf0446c3d7558206b75b4a20f06fd40d47..a088bbb7cde042d048121cae85226aec082bba84 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -304,6 +304,17 @@ void CompositedLayerMapping::updateStickyConstraints(
const StickyPositionScrollingConstraints& constraints =
ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().get(
&m_owningLayer);
+
+ // Find the layout offset of the unshifted sticky box within its enclosing
+ // layer.
+ LayoutPoint enclosingLayerOffset;
+ m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf)
+ ->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(),
+ enclosingLayerOffset);
+ FloatPoint stickyBoxOffset =
+ constraints.scrollContainerRelativeStickyBoxRect().location();
+ stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset));
+
webConstraint.isSticky = true;
webConstraint.isAnchoredLeft =
constraints.anchorEdges() &
@@ -321,6 +332,8 @@ void CompositedLayerMapping::updateStickyConstraints(
webConstraint.rightOffset = constraints.rightOffset();
webConstraint.topOffset = constraints.topOffset();
webConstraint.bottomOffset = constraints.bottomOffset();
+ webConstraint.parentRelativeStickyBoxOffset =
+ roundedIntPoint(stickyBoxOffset);
webConstraint.scrollContainerRelativeStickyBoxRect =
enclosingIntRect(constraints.scrollContainerRelativeStickyBoxRect());
webConstraint.scrollContainerRelativeContainingBlockRect = enclosingIntRect(
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698