Skip to content
Permalink
Browse files
Layers should be destroyed by RenderLayerModelObject
https://bugs.webkit.org/show_bug.cgi?id=178139

Reviewed by Simon Fraser.

Clean up some FIXMEs.

* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
(WebCore::RenderLayerModelObject::destroyLayer):
* rendering/RenderLayerModelObject.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):


Canonical link: https://commits.webkit.org/194382@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed Oct 10, 2017
1 parent 5d6f5dc commit a3e142fcf6e33867aa42136675e978a8c1ef738d
Showing 4 changed files with 22 additions and 14 deletions.
@@ -1,3 +1,19 @@
2017-10-10 Antti Koivisto <antti@apple.com>

Layers should be destroyed by RenderLayerModelObject
https://bugs.webkit.org/show_bug.cgi?id=178139

Reviewed by Simon Fraser.

Clean up some FIXMEs.

* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
(WebCore::RenderLayerModelObject::destroyLayer):
* rendering/RenderLayerModelObject.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):

2017-10-10 Chris Dumez <cdumez@apple.com>

Entries API should recognize path starting with 2 slashes as valid absolute path
@@ -69,18 +69,19 @@ void RenderLayerModelObject::willBeDestroyed()
view().frameView().removeViewportConstrainedObject(this);
}

if (hasLayer()) {
setHasLayer(false);
destroyLayer();
}

RenderElement::willBeDestroyed();

clearRepaintLayoutRects();

// Our layer should have been destroyed and cleared by now
ASSERT(!hasLayer());
ASSERT(!m_layer);
}

void RenderLayerModelObject::destroyLayer()
{
ASSERT(!hasLayer()); // Callers should have already called setHasLayer(false)
ASSERT(!hasLayer());
ASSERT(m_layer);
if (m_layer->isSelfPaintingLayer())
clearRepaintLayoutRects();
@@ -40,7 +40,6 @@ class RenderLayerModelObject : public RenderElement {
public:
virtual ~RenderLayerModelObject();

// Called by RenderObject::willBeDestroyed() and is the only way layers should ever be destroyed
void destroyLayer();

bool hasSelfPaintingLayer() const;
@@ -1434,14 +1434,6 @@ void RenderObject::willBeDestroyed()
if (AXObjectCache* cache = document().existingAXObjectCache())
cache->remove(this);

// FIXME: Would like to do this in RenderBoxModelObject, but the timing is so complicated that this can't easily
// be moved into RenderLayerModelObject::willBeDestroyed().
// FIXME: Is this still true?
if (hasLayer()) {
setHasLayer(false);
downcast<RenderLayerModelObject>(*this).destroyLayer();
}

removeRareData();
}

0 comments on commit a3e142f

Please sign in to comment.