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 7db7ff8cfcba5dc1d6b77569bd23183fc424a520..8fe03615a776995f6d2b9c1c093d22bba8309257 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[9]; |
+ void* pointers[10]; |
LayoutUnit layoutUnits[4]; |
IntSize size; |
OwnPtrWillBePersistent<PaintLayerScrollableArea> scrollableArea; |
@@ -173,6 +173,7 @@ PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject, PaintLayerType type) |
, m_last(0) |
, m_staticInlinePosition(0) |
, m_staticBlockPosition(0) |
+ , m_ancestorOverflowLayer(nullptr) |
{ |
updateStackingNode(); |
@@ -352,7 +353,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 |
@@ -771,7 +773,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. |
@@ -822,10 +824,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); |
@@ -837,7 +837,6 @@ bool PaintLayer::updateLayerPosition() |
localPoint.moveBy(-inlineBoundingBoxOffset); |
if (m_location != localPoint) { |
- positionOrOffsetChanged = true; |
setNeedsRepaint(); |
} |
m_location = localPoint; |
@@ -845,7 +844,6 @@ bool PaintLayer::updateLayerPosition() |
#if ENABLE(ASSERT) |
m_needsPositionUpdate = false; |
#endif |
- return positionOrOffsetChanged; |
} |
TransformationMatrix PaintLayer::perspectiveTransform() const |
@@ -1208,6 +1206,9 @@ 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()) |
@@ -1261,6 +1262,9 @@ PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild) |
oldChild->setPreviousSibling(0); |
oldChild->setNextSibling(0); |
oldChild->m_parent = 0; |
+ if (oldChild->ancestorOverflowLayer()) |
chrishtr
2016/03/24 17:36:03
Do you have a layout test involving removal of pai
flackr
2016/03/29 16:02:32
sticky-overflow-changed.html does test layer remov
|
+ oldChild->ancestorOverflowLayer()->getScrollableArea()->invalidateStickyConstraintsFor(oldChild); |
+ oldChild->updateAncestorOverflowLayer(nullptr); |
dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |