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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2002153007: Refactor to simplify how layerType is stored on PaintLayers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 6a795f67e699618fb651b9d3d7be0be9f15969f6..bf95cce6a1de7170528d797861933c750261b542 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -206,7 +206,7 @@ void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt
if (!layer() && layerCreationAllowedForSubtree()) {
if (wasFloatingBeforeStyleChanged && isFloating())
setChildNeedsLayout();
- createLayer(type);
+ createLayer();
if (parent() && !needsLayout()) {
// FIXME: We should call a specialized version of this function.
layer()->updateLayerPositionsAfterLayout();
@@ -228,10 +228,6 @@ void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt
}
if (layer()) {
- // FIXME: Ideally we shouldn't need this setter but we can't easily infer an overflow-only layer
- // from the style.
- layer()->setLayerType(type);
-
layer()->styleDidChange(diff, oldStyle);
if (hadLayer && layer()->isSelfPaintingLayer() != layerWasSelfPainting)
setChildNeedsLayout();
@@ -331,10 +327,10 @@ void LayoutBoxModelObject::invalidateStickyConstraints()
ancestorOverflowLayer->getScrollableArea()->invalidateAllStickyConstraints();
}
-void LayoutBoxModelObject::createLayer(PaintLayerType type)
+void LayoutBoxModelObject::createLayer()
{
ASSERT(!m_layer);
- m_layer = adoptPtr(new PaintLayer(this, type));
+ m_layer = adoptPtr(new PaintLayer(this));
setHasLayer(true);
m_layer->insertOnlyThisLayerAfterStyleChange();
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698