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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style errors and remaining layout tests. Created 5 years, 3 months 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: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index 561020b810667e0304e8f6c13af08d4f3a715cec..f62aae8c10dbe6299fbe966773f6e5e8268f10b4 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -313,7 +313,16 @@ void DeprecatedPaintLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatu
bool DeprecatedPaintLayer::scrollsWithViewport() const
{
- return layoutObject()->style()->position() == FixedPosition && layoutObject()->containerForFixedPosition() == layoutObject()->view();
+ return (layoutObject()->style()->position() == FixedPosition && layoutObject()->containerForFixedPosition() == layoutObject()->view())
+ || (layoutObject()->style()->position() == StickyPosition && !ancestorScrollingLayer());
+}
+
+bool DeprecatedPaintLayer::scrollsWithScrollAncestor() const
+{
+ // TODO(flackr): This could check if the ancestor scroller for this layer is scrollable and
+ // composited but this would need to be determined before the composite phase as it's used
+ // as a compositing reason.
flackr 2015/09/15 21:13:11 Is there an easy way to check the scroll ancestor
+ return layoutObject()->style()->position() == StickyPosition;
}
bool DeprecatedPaintLayer::scrollsWithRespectTo(const DeprecatedPaintLayer* other) const

Powered by Google App Engine
This is Rietveld 408576698