Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2549353002: Implement PaintLayer::scrollsWithViewport for SPv2. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..dc1d92cc4b4080470ab9199fa82a76b4c95fed4a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -339,11 +339,26 @@ void PaintLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus() {
}
bool PaintLayer::scrollsWithViewport() const {
- return (layoutObject()->style()->position() == FixedPosition &&
- layoutObject()->containerForFixedPosition() ==
- layoutObject()->view()) ||
- (layoutObject()->style()->position() == StickyPosition &&
- !ancestorScrollingLayer());
+ if (layoutObject()->style()->position() == FixedPosition &&
pdr. 2016/12/06 04:38:51 Can you move the spv2 codepath outside like so? if
chrishtr 2016/12/06 23:56:06 This isn't quite right, because the method should
+ layoutObject()->containerForFixedPosition() == layoutObject()->view())
+ return true;
+ if (layoutObject()->style()->position() == StickyPosition) {
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
+ DCHECK(layoutObject()->paintProperties());
+ return layoutObject()
+ ->paintProperties()
+ ->localBorderBoxProperties()
+ ->propertyTreeState.scroll() ==
+ layoutObject()
+ ->view()
+ ->paintProperties()
+ ->contentsProperties()
+ .propertyTreeState.scroll();
+ } else {
+ return !ancestorScrollingLayer();
+ }
+ }
+ return false;
}
bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const {

Powered by Google App Engine
This is Rietveld 408576698