Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
index 1076826b28bd9a6aa4651db6a5eb340c0e3a0ee0..089e1851d78d96b3f06043b49dffd355f17a4c41 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
@@ -74,7 +74,7 @@ LayoutBoxModelObject* findFirstStickyBetween(LayoutObject* from, |
LayoutObject* to) { |
LayoutObject* maybeStickyAncestor = from; |
while (maybeStickyAncestor && maybeStickyAncestor != to) { |
- if (maybeStickyAncestor->isStickyPositioned()) { |
+ if (maybeStickyAncestor->style()->hasStickyConstrainedPosition()) { |
return toLayoutBoxModelObject(maybeStickyAncestor); |
} |
@@ -249,7 +249,8 @@ void LayoutBoxModelObject::willBeDestroyed() { |
// 0 during destruction. |
if (LocalFrame* frame = this->frame()) { |
if (FrameView* frameView = frame->view()) { |
- if (style()->hasViewportConstrainedPosition()) |
+ if (style()->hasViewportConstrainedPosition() || |
+ style()->hasStickyConstrainedPosition()) |
frameView->removeViewportConstrainedObject(*this); |
} |
} |
@@ -430,9 +431,9 @@ void LayoutBoxModelObject::styleDidChange(StyleDifference diff, |
style()->position() == EPosition::kFixed; |
bool oldStyleIsViewportConstrained = |
oldStyle && oldStyle->position() == EPosition::kFixed; |
- bool newStyleIsSticky = style()->position() == EPosition::kSticky; |
+ bool newStyleIsSticky = style()->hasStickyConstrainedPosition(); |
bool oldStyleIsSticky = |
- oldStyle && oldStyle->position() == EPosition::kSticky; |
+ oldStyle && oldStyle->hasStickyConstrainedPosition(); |
if (newStyleIsSticky != oldStyleIsSticky) { |
if (newStyleIsSticky) { |
@@ -1053,6 +1054,8 @@ void LayoutBoxModelObject::updateStickyPositionConstraints() const { |
constraints.addAnchorEdge( |
StickyPositionScrollingConstraints::AnchorEdgeBottom); |
} |
+ // At least one edge should be anchored if we are calculating constraints. |
+ DCHECK(constraints.anchorEdges()); |
scrollableArea->stickyConstraintsMap().set(layer(), constraints); |
} |