Move destroyLeftoverChildren call to RenderObject::destroy
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 19:34:32 +0000 (19:34 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 19:34:32 +0000 (19:34 +0000)
commitbd63f3b79a4044b2a254c876e2bb11c348d3fd90
tree8c7e4c53300afdd3f1558348664fa943457592d3
parent9f81c6fc70175be0a28abb8a4ec0123d6b07e7f1
Move destroyLeftoverChildren call to RenderObject::destroy
https://bugs.webkit.org/show_bug.cgi?id=179819

Reviewed by Zalan Bujtas.

This is currently called inconsistenly from various willBeDestroyed implementations.
We should always call it before invoking willBeDestroyed.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
(WebCore::RenderElement::setLastChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):

    Add some release asserts verifying layer has been detached before destruction.
    This would reveal cases where destroyLeftoverChildren was called too late.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::destroy):

    Call destroyLeftoverChildren.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderObject.cpp