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

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

Issue 1798263002: Rename isTreatedAsOrStackingContext to isStacked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows compile 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/PaintLayerStackingNode.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp b/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
index 03883ee8f4a183607df7634b3cb0d24eef224dc4..a37c621510e2a31d5398449dfcf255c9ba1bcaa8 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
@@ -52,7 +52,7 @@
namespace blink {
// FIXME: This should not require PaintLayer. There is currently a cycle where
-// in order to determine if we shoulBeTreatedAsStackingContext() we have to ask the paint
+// in order to determine if we isStacked() we have to ask the paint
// layer about some of its state.
PaintLayerStackingNode::PaintLayerStackingNode(PaintLayer* layer)
: m_layer(layer)
@@ -61,7 +61,7 @@ PaintLayerStackingNode::PaintLayerStackingNode(PaintLayer* layer)
, m_stackingParent(0)
#endif
{
- m_isTreatedAsOrStackingContext = shouldBeTreatedAsOrStackingContext();
+ m_isStacked = layoutObject()->styleRef().isStacked();
// Non-stacking contexts should have empty z-order lists. As this is already the case,
// there is no need to dirty / recompute these lists.
@@ -161,7 +161,7 @@ void PaintLayerStackingNode::collectLayers(OwnPtr<Vector<PaintLayerStackingNode*
if (layer()->isInTopLayer())
return;
- if (isTreatedAsOrStackingContext()) {
+ if (isStacked()) {
OwnPtr<Vector<PaintLayerStackingNode*>>& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
if (!buffer)
buffer = adoptPtr(new Vector<PaintLayerStackingNode*>);
@@ -217,13 +217,14 @@ void PaintLayerStackingNode::updateLayerListsIfNeeded()
reflectionLayer->stackingNode()->updateZOrderLists();
}
-void PaintLayerStackingNode::updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle)
+void PaintLayerStackingNode::styleDidChange(const ComputedStyle* oldStyle)
{
- bool wasStackingContext = oldStyle ? !oldStyle->hasAutoZIndex() : false;
+ bool wasStackingContext = oldStyle ? oldStyle->isStackingContext() : false;
int oldZIndex = oldStyle ? oldStyle->zIndex() : 0;
bool isStackingContext = this->isStackingContext();
- if (isStackingContext == wasStackingContext && oldZIndex == zIndex())
+ bool shouldBeStacked = layoutObject()->styleRef().isStacked();
+ if (isStackingContext == wasStackingContext && m_isStacked == shouldBeStacked && oldZIndex == zIndex())
return;
dirtyStackingContextZOrderLists();
@@ -232,18 +233,12 @@ void PaintLayerStackingNode::updateStackingNodesAfterStyleChange(const ComputedS
dirtyZOrderLists();
else
clearZOrderLists();
-}
-
-void PaintLayerStackingNode::updateIsTreatedAsStackingContext()
-{
- bool isTreatedAsOrStackingContext = shouldBeTreatedAsOrStackingContext();
- if (isTreatedAsOrStackingContext == this->isTreatedAsOrStackingContext())
- return;
- m_isTreatedAsOrStackingContext = isTreatedAsOrStackingContext;
- if (!layoutObject()->documentBeingDestroyed() && !layer()->isRootLayer())
- compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
- dirtyStackingContextZOrderLists();
+ if (m_isStacked != shouldBeStacked) {
+ m_isStacked = shouldBeStacked;
+ if (!layoutObject()->documentBeingDestroyed() && !layer()->isRootLayer())
+ compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
+ }
}
PaintLayerStackingNode* PaintLayerStackingNode::ancestorStackingContextNode() const

Powered by Google App Engine
This is Rietveld 408576698