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

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

Issue 1850703002: Revert "Adapt and reland old position sticky implementation from https://codereview.chromium.org/34… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 6e27e2f33d7b4e52769ebccf72c6556af2e43f4d..8f1f0f4ef00283350b9dc167cce91cc5b4168e6d 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -99,7 +99,7 @@ static CompositingQueryMode gCompositingQueryMode =
struct SameSizeAsPaintLayer : DisplayItemClient {
int bitFields;
- void* pointers[10];
+ void* pointers[9];
LayoutUnit layoutUnits[4];
IntSize size;
OwnPtrWillBePersistent<PaintLayerScrollableArea> scrollableArea;
@@ -172,7 +172,6 @@ PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject, PaintLayerType type)
, m_last(0)
, m_staticInlinePosition(0)
, m_staticBlockPosition(0)
- , m_ancestorOverflowLayer(nullptr)
{
updateStackingNode();
@@ -350,8 +349,7 @@ void PaintLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus()
bool PaintLayer::scrollsWithViewport() const
{
- return (layoutObject()->style()->position() == FixedPosition && layoutObject()->containerForFixedPosition() == layoutObject()->view())
- || (layoutObject()->style()->position() == StickyPosition && !ancestorScrollingLayer());
+ return layoutObject()->style()->position() == FixedPosition && layoutObject()->containerForFixedPosition() == layoutObject()->view();
}
bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const
@@ -749,7 +747,7 @@ bool PaintLayer::update3DTransformedDescendantStatus()
return has3DTransform();
}
-void PaintLayer::updateLayerPosition()
+bool 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.
@@ -800,8 +798,10 @@ void 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);
@@ -813,6 +813,7 @@ void PaintLayer::updateLayerPosition()
localPoint.moveBy(-inlineBoundingBoxOffset);
if (m_location != localPoint) {
+ positionOrOffsetChanged = true;
setNeedsRepaint();
}
m_location = localPoint;
@@ -820,6 +821,7 @@ void PaintLayer::updateLayerPosition()
#if ENABLE(ASSERT)
m_needsPositionUpdate = false;
#endif
+ return positionOrOffsetChanged;
}
TransformationMatrix PaintLayer::perspectiveTransform() const
@@ -1182,9 +1184,6 @@ void PaintLayer::addChild(PaintLayer* child, PaintLayer* beforeChild)
child->m_parent = this;
- // The ancestor overflow layer is calculated during compositing inputs update and should not be set yet.
- ASSERT(!child->ancestorOverflowLayer());
-
setNeedsCompositingInputsUpdate();
if (!child->stackingNode()->isStacked() && !layoutObject()->documentBeingDestroyed())
@@ -1238,9 +1237,6 @@ PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild)
oldChild->setPreviousSibling(0);
oldChild->setNextSibling(0);
oldChild->m_parent = 0;
- if (oldChild->ancestorOverflowLayer())
- oldChild->ancestorOverflowLayer()->getScrollableArea()->invalidateStickyConstraintsFor(oldChild);
- oldChild->updateAncestorOverflowLayer(nullptr);
dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698