| Index: third_party/WebKit/Source/core/frame/FrameView.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| index 4064b51cbf5b49812c69c33efe2004d6d2536deb..d6cecb3fd45e038d3b87a393c7151354fb551801 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -1957,11 +1957,18 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() {
|
| if (!hasViewportConstrainedObjects())
|
| return;
|
|
|
| - // Update sticky position objects which are stuck to the viewport.
|
| + // Update sticky position objects which are stuck to the viewport. In order to
|
| + // correctly compute the sticky position offsets, the layers must be visited
|
| + // top-down, so start at the 'root' sticky elements and recurse downwards.
|
| for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
|
| LayoutObject* layoutObject = viewportConstrainedObject;
|
| PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
|
| - if (layoutObject->style()->position() == EPosition::kSticky) {
|
| + StickyConstraintsMap constraintsMap = layer->ancestorOverflowLayer()
|
| + ->getScrollableArea()
|
| + ->stickyConstraintsMap();
|
| + if (layoutObject->style()->position() == EPosition::kSticky &&
|
| + constraintsMap.contains(layer) &&
|
| + !constraintsMap.get(layer).hasAncestorStickyElement()) {
|
| // TODO(skobes): Resolve circular dependency between scroll offset and
|
| // compositing state, and remove this disabler. https://crbug.com/420741
|
| DisableCompositingQueryAsserts disabler;
|
|
|