Skip to content

Commit

Permalink
Merge r175580 - RenderBox shouldn't need a pre-destructor hook.
Browse files Browse the repository at this point in the history
<https://webkit.org/b/138367>

Reviewed by Antti Koivisto.

Move teardown logic from willBeDestroyed() to the regular ~RenderBox()
destructor since none of it depends on being in-tree or having a fully
constructed vtable.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::willBeDestroyed): Deleted.
* rendering/RenderBox.h:

Canonical link: https://commits.webkit.org/154760.188@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@175948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling authored and carlosgcampos committed Nov 11, 2014
1 parent cbfc4d3 commit 124be3e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2014-11-04 Andreas Kling <akling@apple.com>

RenderBox shouldn't need a pre-destructor hook.
<https://webkit.org/b/138367>

Reviewed by Antti Koivisto.

Move teardown logic from willBeDestroyed() to the regular ~RenderBox()
destructor since none of it depends on being in-tree or having a fully
constructed vtable.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::willBeDestroyed): Deleted.
* rendering/RenderBox.h:

2014-11-04 Andreas Kling <akling@apple.com>

RenderQuote shouldn't need a pre-destructor hook.
Expand Down
33 changes: 14 additions & 19 deletions Source/WebCore/rendering/RenderBox.cpp
Expand Up @@ -129,6 +129,20 @@ RenderBox::RenderBox(Document& document, PassRef<RenderStyle> style, unsigned ba

RenderBox::~RenderBox()
{
if (frame().eventHandler().autoscrollRenderer() == this)
frame().eventHandler().stopAutoscrollTimer(true);

clearOverrideSize();
#if ENABLE(CSS_GRID_LAYOUT)
clearContainingBlockOverrideSize();
#endif

RenderBlock::removePercentHeightDescendantIfNeeded(*this);

#if ENABLE(CSS_SHAPES)
ShapeOutsideInfo::removeInfo(*this);
#endif

view().unscheduleLazyRepaint(*this);
if (hasControlStatesForRenderer(this))
removeControlStatesForRenderer(this);
Expand Down Expand Up @@ -234,25 +248,6 @@ LayoutRect RenderBox::borderBoxRectInRegion(RenderRegion* region, RenderBoxRegio
return LayoutRect(0, logicalLeft, width(), logicalWidth);
}

void RenderBox::willBeDestroyed()
{
if (frame().eventHandler().autoscrollRenderer() == this)
frame().eventHandler().stopAutoscrollTimer(true);

clearOverrideSize();
#if ENABLE(CSS_GRID_LAYOUT)
clearContainingBlockOverrideSize();
#endif

RenderBlock::removePercentHeightDescendantIfNeeded(*this);

#if ENABLE(CSS_SHAPES)
ShapeOutsideInfo::removeInfo(*this);
#endif

RenderBoxModelObject::willBeDestroyed();
}

RenderBlockFlow* RenderBox::outermostBlockContainingFloatingObject()
{
ASSERT(isFloating());
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/rendering/RenderBox.h
Expand Up @@ -615,8 +615,6 @@ class RenderBox : public RenderBoxModelObject {
RenderBox(Element&, PassRef<RenderStyle>, unsigned baseTypeFlags);
RenderBox(Document&, PassRef<RenderStyle>, unsigned baseTypeFlags);

virtual void willBeDestroyed() override;

virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) override;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
virtual void updateFromStyle() override;
Expand Down

0 comments on commit 124be3e

Please sign in to comment.