⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179877 in webkit


Ignore:
Timestamp:
Feb 10, 2015, 12:27:40 PM (12 years ago)
Author:
Alan Bujtas
Message:

REGRESSION (r168046): Crash in WebCore::InlineBox::renderer / WebCore::RenderFlowThread::checkLinesConsistency
https://bugs.webkit.org/show_bug.cgi?id=133462

Reviewed by David Hyatt.

RenderFlowThread::m_lineToRegionMap stores pointers to the root inlineboxes in the block flow.
Normally root inlineboxes remove themselves from this map in their dtors. However when collapsing an anonymous block,
we detach the inline tree first and destroy them after. The detached root boxes can't access
the flowthread containing block and we end up with dangling pointers in this map.
Call removeFlowChildInfo() before detaching the subtree to ensure proper pointer removal.

Source/WebCore:

Test: fast/multicol/newmulticol/crash-when-switching-to-floating.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::collapseAnonymousBoxChild):

LayoutTests:

  • fast/multicol/newmulticol/crash-when-switching-to-floating-expected.txt: Added.
  • fast/multicol/newmulticol/crash-when-switching-to-floating.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r179872 r179877  
     12015-02-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r168046): Crash in WebCore::InlineBox::renderer / WebCore::RenderFlowThread::checkLinesConsistency
     4        https://bugs.webkit.org/show_bug.cgi?id=133462
     5
     6        Reviewed by David Hyatt.
     7
     8        RenderFlowThread::m_lineToRegionMap stores pointers to the root inlineboxes in the block flow.
     9        Normally root inlineboxes remove themselves from this map in their dtors. However when collapsing an anonymous block,
     10        we detach the inline tree first and destroy them after. The detached root boxes can't access
     11        the flowthread containing block and we end up with dangling pointers in this map.
     12        Call removeFlowChildInfo() before detaching the subtree to ensure proper pointer removal.
     13
     14        * fast/multicol/newmulticol/crash-when-switching-to-floating-expected.txt: Added.
     15        * fast/multicol/newmulticol/crash-when-switching-to-floating.html: Added.
     16
    1172015-02-10  David Kilzer  <ddkilzer@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r179871 r179877  
     12015-02-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r168046): Crash in WebCore::InlineBox::renderer / WebCore::RenderFlowThread::checkLinesConsistency
     4        https://bugs.webkit.org/show_bug.cgi?id=133462
     5
     6        Reviewed by David Hyatt.
     7
     8        RenderFlowThread::m_lineToRegionMap stores pointers to the root inlineboxes in the block flow.
     9        Normally root inlineboxes remove themselves from this map in their dtors. However when collapsing an anonymous block,
     10        we detach the inline tree first and destroy them after. The detached root boxes can't access
     11        the flowthread containing block and we end up with dangling pointers in this map.
     12        Call removeFlowChildInfo() before detaching the subtree to ensure proper pointer removal.
     13
     14        Test: fast/multicol/newmulticol/crash-when-switching-to-floating.html
     15
     16        * rendering/RenderBlock.cpp:
     17        (WebCore::RenderBlock::collapseAnonymousBoxChild):
     18
    1192015-02-10  Julien Isorce  <j.isorce@samsung.com>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r179627 r179877  
    673673    RenderObject* nextSibling = child->nextSibling();
    674674
    675     RenderFlowThread* childFlowThread = child->flowThreadContainingBlock();
    676     if (is<RenderNamedFlowThread>(childFlowThread))
    677         downcast<RenderNamedFlowThread>(*childFlowThread).removeFlowChildInfo(child);
     675    if (auto* childFlowThread = child->flowThreadContainingBlock())
     676        childFlowThread->removeFlowChildInfo(child);
    678677
    679678    parent.removeChildInternal(*child, child->hasLayer() ? NotifyChildren : DontNotifyChildren);
Note: See TracChangeset for help on using the changeset viewer.