Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| index d9d504bf573b63b0e753f78cd7ab3c20467d2b50..9d2a3f9de0df62a9bd1ed4ab50fe1693356e3b98 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| @@ -231,8 +231,21 @@ bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition( |
| // container rather than the enclosing frame. |
| if (layer->sticksToViewport()) |
| return m_layoutView.frameView()->isScrollable(); |
| - return layer->layoutObject().style()->position() == EPosition::kSticky && |
| - layer->ancestorOverflowLayer()->scrollsOverflow(); |
| + |
| + if (layer->layoutObject().style()->position() != EPosition::kSticky) |
| + return false; |
| + |
| + // Don't promote nested sticky elements; the compositor can't handle them. |
| + // TODO(smcgruer): Add cc nested sticky support (http://crbug.com/672710) |
| + PaintLayerScrollableArea* scrollableArea = |
| + layer->ancestorOverflowLayer()->getScrollableArea(); |
| + PaintLayer* nonConstLayer = const_cast<PaintLayer*>(layer); |
| + DCHECK(scrollableArea->stickyConstraintsMap().contains(nonConstLayer)); |
| + |
| + return layer->ancestorOverflowLayer()->scrollsOverflow() && |
| + !scrollableArea->stickyConstraintsMap() |
| + .get(nonConstLayer) |
|
flackr
2017/02/24 01:33:33
nit: I think it'd be better to do the const conver
smcgruer
2017/02/24 14:17:43
Done.
|
| + .hasAncestorStickyElement(); |
| } |
| } // namespace blink |