| Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| index 13ad90d19de26da9a0d2cb6928d177f0892fa477..f34e827ef456f098ad905f07dbe09a08a7c77ddd 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| @@ -338,7 +338,33 @@ void PaintLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus() {
|
| }
|
| }
|
|
|
| -bool PaintLayer::scrollsWithViewport() const {
|
| +bool PaintLayer::sticksToViewport() const {
|
| + if (layoutObject()->style()->position() != FixedPosition &&
|
| + layoutObject()->style()->position() != StickyPosition)
|
| + return false;
|
| +
|
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| + const ScrollPaintPropertyNode* ancestorTargetScrollNode;
|
| + if (layoutObject()->style()->position() == FixedPosition) {
|
| + ancestorTargetScrollNode = layoutObject()
|
| + ->view()
|
| + ->paintProperties()
|
| + ->localBorderBoxProperties()
|
| + ->propertyTreeState.scroll();
|
| + } else {
|
| + ancestorTargetScrollNode = layoutObject()
|
| + ->view()
|
| + ->paintProperties()
|
| + ->contentsProperties()
|
| + .propertyTreeState.scroll();
|
| + }
|
| +
|
| + return layoutObject()
|
| + ->paintProperties()
|
| + ->localBorderBoxProperties()
|
| + ->propertyTreeState.scroll() == ancestorTargetScrollNode;
|
| + }
|
| +
|
| return (layoutObject()->style()->position() == FixedPosition &&
|
| layoutObject()->containerForFixedPosition() ==
|
| layoutObject()->view()) ||
|
| @@ -347,7 +373,7 @@ bool PaintLayer::scrollsWithViewport() const {
|
| }
|
|
|
| bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const {
|
| - if (scrollsWithViewport() != other->scrollsWithViewport())
|
| + if (sticksToViewport() != other->sticksToViewport())
|
| return true;
|
| return ancestorScrollingLayer() != other->ancestorScrollingLayer();
|
| }
|
|
|