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

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: Merge with master and skip anonymous containing blocks for sticky container. Created 4 years, 11 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 8d1acb0fd921de3457807fea646a0663891ac439..76442a99e572512aadba33fc6382472f83b9adf6 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -322,7 +322,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
@@ -720,7 +721,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.
@@ -771,10 +772,8 @@ bool PaintLayer::updateLayerPosition()
localPoint -= scrollOffset;
}
- bool positionOrOffsetChanged = false;
if (layoutObject()->isInFlowPositioned()) {
LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
- positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition;
m_offsetForInFlowPosition = newOffset;
localPoint.move(m_offsetForInFlowPosition);
} else {
@@ -785,7 +784,6 @@ bool PaintLayer::updateLayerPosition()
localPoint.moveBy(-inlineBoundingBoxOffset);
if (m_location != localPoint) {
- positionOrOffsetChanged = true;
setNeedsRepaint();
}
m_location = localPoint;
@@ -793,7 +791,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