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

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

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP - fix on release, still hits CHECK in LayoutGeometryMap.cpp:156 Created 4 years, 10 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: 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 b5b1f61f18e55984c8d0aff52600ebfce8eb656f..320618d6440c0849c6996760849f45dd126ee165 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -354,7 +354,8 @@ void PaintLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus()
bool PaintLayer::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 PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const
@@ -753,7 +754,7 @@ bool PaintLayer::update3DTransformedDescendantStatus()
return has3DTransform();
}
-bool PaintLayer::updateLayerPosition()
+void PaintLayer::updateLayerPosition()
{
LayoutPoint localPoint;
LayoutPoint inlineBoundingBoxOffset; // We don't put this into the Layer x/y for inlines, so we need to subtract it out when done.
@@ -804,10 +805,8 @@ bool PaintLayer::updateLayerPosition()
localPoint -= scrollOffset;
}
- bool positionOrOffsetChanged = false;
if (layoutObject()->isInFlowPositioned()) {
LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
- positionOrOffsetChanged = newOffset != offsetForInFlowPosition();
if (m_rareData || !newOffset.isZero())
ensureRareData().offsetForInFlowPosition = newOffset;
localPoint.move(newOffset);
@@ -819,7 +818,6 @@ bool PaintLayer::updateLayerPosition()
localPoint.moveBy(-inlineBoundingBoxOffset);
if (m_location != localPoint) {
- positionOrOffsetChanged = true;
setNeedsRepaint();
}
m_location = localPoint;
@@ -827,7 +825,6 @@ bool PaintLayer::updateLayerPosition()
#if ENABLE(ASSERT)
m_needsPositionUpdate = false;
#endif
- return positionOrOffsetChanged;
}
TransformationMatrix PaintLayer::perspectiveTransform() const

Powered by Google App Engine
This is Rietveld 408576698