Changeset 142056 in webkit


Ignore:
Timestamp:
Feb 6, 2013 4:55:10 PM (11 years ago)
Author:
ojan@chromium.org
Message:

[Chromium] table-section-overflow-clip-crash.html hits an assert
https://bugs.webkit.org/show_bug.cgi?id=108594

Reviewed by Levi Weintraub.

Source/WebCore:

When a counter calls setNeedsLayout, it also marks it's containing blocks
as needing layout, so we need to clear the setNeedsLayoutIsForbidden bit on the
containing blocks as well as the counter itself.

Also, use RAII objects for all the places where we clear this bit and make
the setter/getter for it private to RenderObject.

  • rendering/RenderCounter.cpp:

(WebCore::RenderCounter::computePreferredLogicalWidths):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope):
(WebCore::RenderObject::markContainingBlocksForLayout):

  • rendering/RenderObject.h:

(SetLayoutNeededForbiddenScope):
(RenderObject):
(WebCore::RenderObject::isSetNeedsLayoutForbidden):
(WebCore::RenderObject::setNeedsLayoutIsForbidden):

  • rendering/RenderQuote.cpp:

(WebCore::RenderQuote::computePreferredLogicalWidths):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layoutRows):

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):

  • rendering/mathml/RenderMathMLRoot.cpp:

(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):

  • rendering/mathml/RenderMathMLRow.cpp:

(WebCore::RenderMathMLRow::computePreferredLogicalWidths):

LayoutTests:

  • platform/chromium/TestExpectations:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142054 r142056  
     12013-02-06  Ojan Vafai  <ojan@chromium.org>
     2
     3        [Chromium] table-section-overflow-clip-crash.html hits an assert
     4        https://bugs.webkit.org/show_bug.cgi?id=108594
     5
     6        Reviewed by Levi Weintraub.
     7
     8        * platform/chromium/TestExpectations:
     9
    1102013-02-06  Ojan Vafai  <ojan@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r142051 r142056  
    43454345
    43464346webkit.org/b/108424 media/video-error-does-not-exist.html [ Failure Crash ]
    4347 webkit.org/b/108594 [ Debug ] tables/table-section-overflow-clip-crash.html [ Crash ]
    43484347
    43494348webkit.org/b/108781 [ Win ] fast/css-grid-layout/grid-preferred-logical-widths.html [ Timeout ]
  • trunk/Source/WebCore/ChangeLog

    r142054 r142056  
     12013-02-06  Ojan Vafai  <ojan@chromium.org>
     2
     3        [Chromium] table-section-overflow-clip-crash.html hits an assert
     4        https://bugs.webkit.org/show_bug.cgi?id=108594
     5
     6        Reviewed by Levi Weintraub.
     7
     8        When a counter calls setNeedsLayout, it also marks it's containing blocks
     9        as needing layout, so we need to clear the setNeedsLayoutIsForbidden bit on the
     10        containing blocks as well as the counter itself.
     11
     12        Also, use RAII objects for all the places where we clear this bit and make
     13        the setter/getter for it private to RenderObject.
     14
     15        * rendering/RenderCounter.cpp:
     16        (WebCore::RenderCounter::computePreferredLogicalWidths):
     17        * rendering/RenderObject.cpp:
     18        (WebCore::RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope):
     19        (WebCore::RenderObject::markContainingBlocksForLayout):
     20        * rendering/RenderObject.h:
     21        (SetLayoutNeededForbiddenScope):
     22        (RenderObject):
     23        (WebCore::RenderObject::isSetNeedsLayoutForbidden):
     24        (WebCore::RenderObject::setNeedsLayoutIsForbidden):
     25        * rendering/RenderQuote.cpp:
     26        (WebCore::RenderQuote::computePreferredLogicalWidths):
     27        * rendering/RenderTableSection.cpp:
     28        (WebCore::RenderTableSection::calcRowLogicalHeight):
     29        (WebCore::RenderTableSection::layoutRows):
     30        * rendering/mathml/RenderMathMLOperator.cpp:
     31        (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
     32        * rendering/mathml/RenderMathMLRoot.cpp:
     33        (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
     34        * rendering/mathml/RenderMathMLRow.cpp:
     35        (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
     36
    1372013-02-06  Ojan Vafai  <ojan@chromium.org>
    238
  • trunk/Source/WebCore/rendering/RenderCounter.cpp

    r141517 r142056  
    526526    // computePreferredLogicalWidths at all.
    527527    // https://bugs.webkit.org/show_bug.cgi?id=104829
    528     bool oldSetNeedsLayoutIsForbidden = isSetNeedsLayoutForbidden();
    529     setNeedsLayoutIsForbidden(false);
     528    SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
    530529#endif
    531530
    532531    setTextInternal(originalText());
    533 
    534 #ifndef NDEBUG
    535     setNeedsLayoutIsForbidden(oldSetNeedsLayoutIsForbidden);
    536 #endif
    537532
    538533    RenderText::computePreferredLogicalWidths(lead);
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r142015 r142056  
    9595static void* baseOfRenderObjectBeingDeleted;
    9696
    97 RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(RenderObject* renderObject)
     97RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(RenderObject* renderObject, bool isForbidden)
    9898    : m_renderObject(renderObject)
    9999    , m_preexistingForbidden(m_renderObject->isSetNeedsLayoutForbidden())
    100100{
    101     m_renderObject->setNeedsLayoutIsForbidden(true);
     101    m_renderObject->setNeedsLayoutIsForbidden(isForbidden);
    102102}
    103103
     
    655655{
    656656    ASSERT(!scheduleRelayout || !newRoot);
     657    ASSERT(!isSetNeedsLayoutForbidden());
    657658
    658659    RenderObject* object = container();
     
    662663
    663664    while (object) {
     665#ifndef NDEBUG
     666        // FIXME: Remove this once we remove the special cases for counters, quotes and mathml
     667        // calling setNeedsLayout during preferred width computation.
     668        SetLayoutNeededForbiddenScope layoutForbiddenScope(object, isSetNeedsLayoutForbidden());
     669#endif
    664670        // Don't mark the outermost object of an unrooted subtree. That object will be
    665671        // marked when the subtree is added to the document.
  • trunk/Source/WebCore/rendering/RenderObject.h

    r142015 r142056  
    227227    void setHasAXObject(bool flag) { m_hasAXObject = flag; }
    228228    bool hasAXObject() const { return m_hasAXObject; }
    229     bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; }
    230     void setNeedsLayoutIsForbidden(bool flag) { m_setNeedsLayoutForbidden = flag; }
    231229
    232230    // Helper class forbidding calls to setNeedsLayout() during its lifetime.
    233231    class SetLayoutNeededForbiddenScope {
    234232    public:
    235         explicit SetLayoutNeededForbiddenScope(RenderObject*);
     233        explicit SetLayoutNeededForbiddenScope(RenderObject*, bool isForbidden = true);
    236234        ~SetLayoutNeededForbiddenScope();
    237235    private:
     
    273271    //////////////////////////////////////////
    274272private:
     273#ifndef NDEBUG
     274    bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; }
     275    void setNeedsLayoutIsForbidden(bool flag) { m_setNeedsLayoutForbidden = flag; }
     276#endif
     277
    275278    void addAbsoluteRectForLayer(LayoutRect& result);
    276279    void setLayerNeedsFullRepaint();
  • trunk/Source/WebCore/rendering/RenderQuote.cpp

    r141517 r142056  
    257257    // computePreferredLogicalWidths at all.
    258258    // https://bugs.webkit.org/show_bug.cgi?id=104829
    259     bool oldSetNeedsLayoutIsForbidden = isSetNeedsLayoutForbidden();
    260     setNeedsLayoutIsForbidden(false);
     259    SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
    261260#endif
    262261
     
    264263        attachQuote();
    265264    setTextInternal(originalText());
    266 
    267 #ifndef NDEBUG
    268     setNeedsLayoutIsForbidden(oldSetNeedsLayoutIsForbidden);
    269 #endif
    270265
    271266    RenderText::computePreferredLogicalWidths(lead);
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r141570 r142056  
    264264{
    265265#ifndef NDEBUG
    266     setNeedsLayoutIsForbidden(true);
     266    SetLayoutNeededForbiddenScope layoutForbiddenScope(this);
    267267#endif
    268268
     
    339339        m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r]);
    340340    }
    341 
    342 #ifndef NDEBUG
    343     setNeedsLayoutIsForbidden(false);
    344 #endif
    345341
    346342    ASSERT(!needsLayout());
     
    493489{
    494490#ifndef NDEBUG
    495     setNeedsLayoutIsForbidden(true);
     491    SetLayoutNeededForbiddenScope layoutForbiddenScope(this);
    496492#endif
    497493
     
    638634        }
    639635    }
    640 
    641 #ifndef NDEBUG
    642     setNeedsLayoutIsForbidden(false);
    643 #endif
    644636
    645637    ASSERT(!needsLayout());
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r141517 r142056  
    8686
    8787#ifndef NDEBUG
    88     // FIXME: Remove the setNeedsLayoutIsForbidden calls once mathml stops modifying the render tree here.
    89     bool oldSetNeedsLayoutIsForbidden = isSetNeedsLayoutForbidden();
    90     setNeedsLayoutIsForbidden(false);
     88    // FIXME: Remove this once mathml stops modifying the render tree here.
     89    SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
    9190#endif
    9291   
     
    9493    if (!firstChild())
    9594        updateFromElement();
    96 
    97 #ifndef NDEBUG
    98     setNeedsLayoutIsForbidden(oldSetNeedsLayoutIsForbidden);
    99 #endif
    10095
    10196    RenderMathMLBlock::computePreferredLogicalWidths();
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp

    r141517 r142056  
    189189   
    190190#ifndef NDEBUG
    191     // FIXME: Remove the setNeedsLayoutIsForbidden calls once mathml stops modifying the render tree here.
    192     bool oldSetNeedsLayoutIsForbidden = isSetNeedsLayoutForbidden();
    193     setNeedsLayoutIsForbidden(false);
     191    // FIXME: Remove this once mathml stops modifying the render tree here.
     192    SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
    194193#endif
    195194   
     
    227226        m_intrinsicPaddingStart = frontWidth;
    228227
    229 #ifndef NDEBUG
    230     setNeedsLayoutIsForbidden(oldSetNeedsLayoutIsForbidden);
    231 #endif
    232 
    233228    RenderMathMLBlock::computePreferredLogicalWidths();
    234229   
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r141517 r142056  
    5757
    5858#ifndef NDEBUG
    59     // FIXME: Remove the setNeedsLayoutIsForbidden calls once mathml stops modifying the render tree here.
    60     bool oldSetNeedsLayoutIsForbidden = isSetNeedsLayoutForbidden();
    61     setNeedsLayoutIsForbidden(false);
     59    // FIXME: Remove this once mathml stops modifying the render tree here.
     60    SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
    6261#endif
    6362
     
    8584    }
    8685
    87 #ifndef NDEBUG
    88     setNeedsLayoutIsForbidden(oldSetNeedsLayoutIsForbidden);
    89 #endif
    90 
    9186    RenderMathMLBlock::computePreferredLogicalWidths();
    9287   
Note: See TracChangeset for help on using the changeset viewer.