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

Unified Diff: Source/core/rendering/RenderLayerModelObject.cpp

Issue 27246003: Replace check for RenderLayer in RenderLayerModelObject::ensureLayer with ASSERT due to redundant c… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed! Created 7 years, 2 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
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerModelObject.cpp
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index b079c7628006a7c9833931ebb32bfd3543797b4d..0faf2344929c127f41b59c54a5932422b9816473 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -59,11 +59,9 @@ void RenderLayerModelObject::destroyLayer()
m_layer = 0;
}
-void RenderLayerModelObject::ensureLayer()
+void RenderLayerModelObject::createLayer()
{
- if (m_layer)
- return;
-
+ ASSERT(!m_layer);
m_layer = new RenderLayer(this);
setHasLayer(true);
m_layer->insertOnlyThisLayer();
@@ -152,7 +150,7 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
if (!layer() && layerCreationAllowedForSubtree()) {
if (s_wasFloating && isFloating())
setChildNeedsLayout();
- ensureLayer();
+ createLayer();
if (parent() && !needsLayout() && containingBlock()) {
layer()->repainter().setRepaintStatus(NeedsFullRepaint);
// There is only one layer to update, it is not worth using |cachedOffset| since
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698