Chromium Code Reviews| 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 43718b3c8601adccf367e8306bbb5b33f57556d1..9ce58d6376a6e8de78c1da81dc16fd5f3bb1e273 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
| @@ -1928,11 +1928,17 @@ 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() == StickyPosition) { |
| + StickyConstraintsMap constraintsMap = |
| + layer->getScrollableArea()->stickyConstraintsMap(); |
| + if (layoutObject->style()->position() == StickyPosition && |
| + constraintsMap.contains(layer) && |
|
flackr
2017/01/20 02:42:44
Do you know if we do actualy sometimes end up with
smcgruer
2017/01/20 17:18:14
It appears so. I don't know the exact reason, but
|
| + !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; |