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

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

Issue 2025093002: Refactor to simplify how layerType is stored on PaintLayers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
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 228eccda5031afe3f0572b5c25148fbaffabbfbe..74603097141ce1807a09be0ca871b6aeb9db134d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -207,7 +207,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();
@@ -229,10 +229,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();
@@ -332,10 +328,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