Changeset 101556 in webkit


Ignore:
Timestamp:
Nov 30, 2011 2:33:20 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

Assertion failure (m_nestedIsolateCount >= 1) in BidiResolver::exitIsolate()
https://bugs.webkit.org/show_bug.cgi?id=69267

Reviewed by Eric Seidel.

Source/WebCore:

The failure was caused by our updating bidi resolver's current position in layoutRunsAndFloatsInRange
without updating the number of nested isolated ancestors. Fixed the bug by computing the number of
isolated ancestors when setting a new position to the bidi resolver.

Also renamed the existing BidiResolver::setPosition to setPositionIgnoringNestedIsolates because this
version can be used only when we don't have to update the number of nested isolates.

Tests: fast/text/bidi-isolate-hang-with-neutral-expected.html

fast/text/bidi-isolate-hang-with-neutral.html
fast/text/bidi-isolate-nextlinebreak-failure.html

  • platform/graphics/GraphicsContext.cpp:

(WebCore::GraphicsContext::drawBidiText):

  • platform/text/BidiResolver.h:

(WebCore::BidiResolver::setPositionIgnoringNestedIsolates):
(WebCore::BidiResolver::setPosition):

  • rendering/InlineIterator.h:

(WebCore::numberOfIsolateAncestors): Takes InlineIterator instead of object and root.
(WebCore::InlineBidiResolver::appendRun):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::constructBidiRuns):
(WebCore::RenderBlock::layoutRunsAndFloatsInRange):
(WebCore::RenderBlock::determineStartPosition):

LayoutTests:

Add a regression test for the assertion failure. Also add a regression test for a hang
found by Levi Weintraub and Jeremy Moskovich.

This patch also fixes the assertion failure in fast/block/child-not-removed-from-parent-lineboxes-crash.html
introduced by r101268.

  • fast/text/bidi-isolate-hang-with-neutral-expected.html: Added.
  • fast/text/bidi-isolate-hang-with-neutral.html: Added.
  • fast/text/bidi-isolate-nextlinebreak-failure-expected.txt: Added.
  • fast/text/bidi-isolate-nextlinebreak-failure.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101550 r101556  
     12011-11-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Assertion failure (m_nestedIsolateCount >= 1) in BidiResolver::exitIsolate()
     4        https://bugs.webkit.org/show_bug.cgi?id=69267
     5
     6        Reviewed by Eric Seidel.
     7
     8        Add a regression test for the assertion failure. Also add a regression test for a hang
     9        found by Levi Weintraub and Jeremy Moskovich.
     10
     11        This patch also fixes the assertion failure in fast/block/child-not-removed-from-parent-lineboxes-crash.html
     12        introduced by r101268.
     13
     14        * fast/text/bidi-isolate-hang-with-neutral-expected.html: Added.
     15        * fast/text/bidi-isolate-hang-with-neutral.html: Added.
     16        * fast/text/bidi-isolate-nextlinebreak-failure-expected.txt: Added.
     17        * fast/text/bidi-isolate-nextlinebreak-failure.html: Added.
     18
    1192011-11-30  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r101554 r101556  
     12011-11-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Assertion failure (m_nestedIsolateCount >= 1) in BidiResolver::exitIsolate()
     4        https://bugs.webkit.org/show_bug.cgi?id=69267
     5
     6        Reviewed by Eric Seidel.
     7
     8        The failure was caused by our updating bidi resolver's current position in layoutRunsAndFloatsInRange
     9        without updating the number of nested isolated ancestors. Fixed the bug by computing the number of
     10        isolated ancestors when setting a new position to the bidi resolver.
     11
     12        Also renamed the existing BidiResolver::setPosition to setPositionIgnoringNestedIsolates because this
     13        version can be used only when we don't have to update the number of nested isolates.
     14
     15        Tests: fast/text/bidi-isolate-hang-with-neutral-expected.html
     16               fast/text/bidi-isolate-hang-with-neutral.html
     17               fast/text/bidi-isolate-nextlinebreak-failure.html
     18
     19        * platform/graphics/GraphicsContext.cpp:
     20        (WebCore::GraphicsContext::drawBidiText):
     21        * platform/text/BidiResolver.h:
     22        (WebCore::BidiResolver::setPositionIgnoringNestedIsolates):
     23        (WebCore::BidiResolver::setPosition):
     24        * rendering/InlineIterator.h:
     25        (WebCore::numberOfIsolateAncestors): Takes InlineIterator instead of object and root.
     26        (WebCore::InlineBidiResolver::appendRun):
     27        * rendering/RenderBlockLineLayout.cpp:
     28        (WebCore::constructBidiRuns):
     29        (WebCore::RenderBlock::layoutRunsAndFloatsInRange):
     30        (WebCore::RenderBlock::determineStartPosition):
     31
    1322011-11-30  Brent Fulgham  <bfulgham@webkit.org>
    233
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp

    r98406 r101556  
    401401    BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
    402402    bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
    403     bidiResolver.setPosition(TextRunIterator(&run, 0));
     403    bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0));
    404404
    405405    // FIXME: This ownership should be reversed. We should pass BidiRunList
  • trunk/Source/WebCore/platform/text/BidiResolver.h

    r94775 r101556  
    178178
    179179    const Iterator& position() const { return m_current; }
    180     void setPosition(const Iterator& position) { m_current = position; }
     180    void setPositionIgnoringNestedIsolates(const Iterator& position) { m_current = position; }
     181    void setPosition(const Iterator& position, unsigned nestedIsolatedCount)
     182    {
     183        m_current = position;
     184        m_nestedIsolateCount = nestedIsolatedCount;
     185    }
    181186
    182187    void increment() { m_current.increment(); }
  • trunk/Source/WebCore/rendering/InlineIterator.h

    r101406 r101556  
    407407}
    408408
    409 static inline unsigned numberOfIsolateAncestors(RenderObject* object, RenderObject* root)
    410 {
    411     ASSERT(object);
     409static inline unsigned numberOfIsolateAncestors(const InlineIterator& iter)
     410{
     411    RenderObject* object = iter.object();
     412    if (!object)
     413        return 0;
    412414    unsigned count = 0;
    413     while (object && object != root) {
     415    while (object && object != iter.root()) {
    414416        if (isIsolatedInline(object))
    415417            count++;
     
    483485        // Initialize our state depending on if we're starting in the middle of such an inline.
    484486        // FIXME: Could this initialize from this->inIsolate() instead of walking up the render tree?
    485         IsolateTracker isolateTracker(numberOfIsolateAncestors(m_sor.m_obj, m_sor.root()));
     487        IsolateTracker isolateTracker(numberOfIsolateAncestors(m_sor));
    486488        int start = m_sor.m_pos;
    487489        RenderObject* obj = m_sor.m_obj;
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r101180 r101556  
    967967        if (!startObj)
    968968            continue;
    969         isolatedResolver.setPosition(InlineIterator(isolatedSpan, startObj, 0));
     969        isolatedResolver.setPositionIgnoringNestedIsolates(InlineIterator(isolatedSpan, startObj, 0));
    970970
    971971        // FIXME: isolatedEnd should probably equal end or the last char in isolatedSpan.
     
    12171217        layoutState.lineInfo().setEmpty(true);
    12181218
    1219         InlineIterator oldEnd = end;
     1219        const InlineIterator oldEnd = end;
    12201220        bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly();
    12211221        FloatingObject* lastFloatFromPreviousLine = (m_floatingObjects && !m_floatingObjects->set().isEmpty()) ? m_floatingObjects->set().last() : 0;
     
    12851285                            removeFloatingObjectsBelow(lastFloatFromPreviousLine, oldLogicalHeight);
    12861286                            setLogicalHeight(oldLogicalHeight + adjustment);
    1287                             resolver.setPosition(oldEnd);
     1287                            resolver.setPositionIgnoringNestedIsolates(oldEnd);
    12881288                            end = oldEnd;
    12891289                            continue;
     
    13251325
    13261326        lineMidpointState.reset();
    1327         resolver.setPosition(end);
     1327        resolver.setPosition(end, numberOfIsolateAncestors(end));
    13281328    }
    13291329}
     
    16401640    if (last) {
    16411641        setLogicalHeight(last->lineBottomWithLeading());
    1642         resolver.setPosition(InlineIterator(this, last->lineBreakObj(), last->lineBreakPos()));
     1642        InlineIterator iter = InlineIterator(this, last->lineBreakObj(), last->lineBreakPos());
     1643        resolver.setPosition(iter, numberOfIsolateAncestors(iter));
    16431644        resolver.setStatus(last->lineBreakBidiStatus());
    16441645    } else {
     
    16491650        }
    16501651        resolver.setStatus(BidiStatus(direction, style()->unicodeBidi() == Override));
    1651         resolver.setPosition(InlineIterator(this, bidiFirstSkippingEmptyInlines(this, &resolver), 0));
     1652        InlineIterator iter = InlineIterator(this, bidiFirstSkippingEmptyInlines(this, &resolver), 0);
     1653        resolver.setPosition(iter, numberOfIsolateAncestors(iter));
    16521654    }
    16531655    return curr;
Note: See TracChangeset for help on using the changeset viewer.