Changeset 83638 in webkit


Ignore:
Timestamp:
Apr 12, 2011 2:28:24 PM (13 years ago)
Author:
yael.aharon@nokia.com
Message:

2011-04-12 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Eric Seidel.

REGRESSION(r82419): extra border in t0805-c5519-ibrdr-r-00-a.html
https://bugs.webkit.org/show_bug.cgi?id=57459

  • fast/borders/bidi-002.html: Added.
  • fast/borders/bidi-004.html: Added.
  • fast/borders/bidi-009a.html: Added.
  • platform/mac/fast/borders/bidi-002-expected.checksum: Added.
  • platform/mac/fast/borders/bidi-002-expected.png: Added.
  • platform/mac/fast/borders/bidi-002-expected.txt: Added.
  • platform/mac/fast/borders/bidi-004-expected.checksum: Added.
  • platform/mac/fast/borders/bidi-004-expected.png: Added.
  • platform/mac/fast/borders/bidi-004-expected.txt: Added.
  • platform/mac/fast/borders/bidi-009a-expected.checksum: Added.
  • platform/mac/fast/borders/bidi-009a-expected.png: Added.
  • platform/mac/fast/borders/bidi-009a-expected.txt: Added.

2011-04-12 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Eric Seidel.

REGRESSION(r82419): extra border in t0805-c5519-ibrdr-r-00-a.html
https://bugs.webkit.org/show_bug.cgi?id=57459

Slightly change the way we decide if a InlineFlowBox is the last box for its renderer.
We include the border in that box under these conditions:
(1) The next line was not created, or it is constructed. We check the previous line for rtl.
(2) The logicallyLastRun is not a descendant of this renderer.
(3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line.
I added the tests from bug 47210, because now the draw the borders correctly.

Tests: fast/borders/bidi-002.html

fast/borders/bidi-004.html
fast/borders/bidi-009a.html

  • rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::onEndChain): (WebCore::isAnsectorAndWithinBlock): (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
  • rendering/InlineFlowBox.h:
  • rendering/RenderBlock.h:
  • rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::constructLine): (WebCore::RenderBlock::layoutInlineChildren):
Location:
trunk
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83630 r83638  
     12011-04-12  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        REGRESSION(r82419): extra border in t0805-c5519-ibrdr-r-00-a.html
     6        https://bugs.webkit.org/show_bug.cgi?id=57459
     7
     8        * fast/borders/bidi-002.html: Added.
     9        * fast/borders/bidi-004.html: Added.
     10        * fast/borders/bidi-009a.html: Added.
     11        * platform/mac/fast/borders/bidi-002-expected.checksum: Added.
     12        * platform/mac/fast/borders/bidi-002-expected.png: Added.
     13        * platform/mac/fast/borders/bidi-002-expected.txt: Added.
     14        * platform/mac/fast/borders/bidi-004-expected.checksum: Added.
     15        * platform/mac/fast/borders/bidi-004-expected.png: Added.
     16        * platform/mac/fast/borders/bidi-004-expected.txt: Added.
     17        * platform/mac/fast/borders/bidi-009a-expected.checksum: Added.
     18        * platform/mac/fast/borders/bidi-009a-expected.png: Added.
     19        * platform/mac/fast/borders/bidi-009a-expected.txt: Added.
     20
    1212011-04-12  Jessie Berlin  <jberlin@apple.com>
    222
  • trunk/Source/WebCore/ChangeLog

    r83637 r83638  
     12011-04-12  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        REGRESSION(r82419): extra border in t0805-c5519-ibrdr-r-00-a.html
     6        https://bugs.webkit.org/show_bug.cgi?id=57459
     7
     8        Slightly change the way we decide if a InlineFlowBox is the last box for its renderer.
     9        We include the border in that box under these conditions:
     10        (1) The next line was not created, or it is constructed. We check the previous line for rtl.
     11        (2) The logicallyLastRun is not a descendant of this renderer.
     12        (3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line.
     13        I added the tests from bug 47210, because now the draw the borders correctly.
     14
     15        Tests: fast/borders/bidi-002.html
     16               fast/borders/bidi-004.html
     17               fast/borders/bidi-009a.html
     18
     19        * rendering/InlineFlowBox.cpp:
     20        (WebCore::InlineFlowBox::onEndChain):
     21        (WebCore::isAnsectorAndWithinBlock):
     22        (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
     23        * rendering/InlineFlowBox.h:
     24        * rendering/RenderBlock.h:
     25        * rendering/RenderBlockLineLayout.cpp:
     26        (WebCore::RenderBlock::constructLine):
     27        (WebCore::RenderBlock::layoutInlineChildren):
     28
    1292011-04-12  Geoffrey Garen  <ggaren@apple.com>
    230
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r83075 r83638  
    263263    RenderObject* curr = endObject;
    264264    RenderObject* parent = curr->parent();
    265     while (parent && !parent->isRenderBlock()) {
    266         if (parent->lastChild() != curr || parent == renderer())
     265    while (parent && (!parent->isRenderBlock() || parent->isInline())) {
     266        if (parent->lastChild() != curr)
    267267            return false;
     268        if (parent == renderer())
     269            return true;
    268270           
    269271        curr = parent;
     
    277279{
    278280    RenderObject* object = child;
    279     while (object && !object->isRenderBlock()) {
     281    while (object && (!object->isRenderBlock() || object->isInline())) {
    280282        if (object == ancestor)
    281283            return true;
     
    285287}
    286288
    287 void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject, RenderObject* logicallyLastRunRenderer)
     289void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer)
    288290{
    289291    // All boxes start off open.  They will not apply any margins/border/padding on
     
    308310        if (!lineBoxList->lastLineBox()->isConstructed()) {
    309311            RenderInline* inlineFlow = toRenderInline(renderer());
    310             bool isLastObjectOnLine = (endObject && endObject->isText()) ? !isAnsectorAndWithinBlock(renderer(), logicallyLastRunRenderer->parent()) : onEndChain(logicallyLastRunRenderer);
    311 
     312            bool isLastObjectOnLine = !isAnsectorAndWithinBlock(renderer(), logicallyLastRunRenderer) || (onEndChain(logicallyLastRunRenderer) && !isLogicallyLastRunWrapped);
     313
     314            // We include the border under these conditions:
     315            // (1) The next line was not created, or it is constructed. We check the previous line for rtl.
     316            // (2) The logicallyLastRun is not a descendant of this renderer.
     317            // (3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line.
     318           
    312319            if (ltr) {
    313320                if (!nextLineBox()
     
    328335        if (currChild->isInlineFlowBox()) {
    329336            InlineFlowBox* currFlow = static_cast<InlineFlowBox*>(currChild);
    330             currFlow->determineSpacingForFlowBoxes(lastLine, endObject, logicallyLastRunRenderer);
     337            currFlow->determineSpacingForFlowBoxes(lastLine, isLogicallyLastRunWrapped, logicallyLastRunRenderer);
    331338        }
    332339    }
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r83075 r83638  
    160160
    161161    // Helper functions used during line construction and placement.
    162     void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject, RenderObject* logicallyLastRunRenderer);
     162    void determineSpacingForFlowBoxes(bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);
    163163    int getFlowSpacingLogicalWidth();
    164164    bool onEndChain(RenderObject* endObject);
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r83240 r83638  
    502502    InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, LineBreakIteratorInfo&, bool& previousLineBrokeCleanly, bool& hyphenated,
    503503                                     EClear*, FloatingObject* lastFloatFromPreviousLine, Vector<RenderBox*>& positionedObjects);
    504     RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject, RenderObject* logicallyLastRunRenderer);
     504    RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);
    505505    InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine, InlineBox* childBox);
    506506
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r83629 r83638  
    267267}
    268268
    269 RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject, RenderObject* logicallyLastRunRenderer)
     269RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer)
    270270{
    271271    ASSERT(firstRun);
     
    326326    // we determine the horizontal positions and widths of all the inline boxes on
    327327    // the line.
    328     lastLineBox()->determineSpacingForFlowBoxes(lastLine, endObject, logicallyLastRunRenderer);
     328    lastLineBox()->determineSpacingForFlowBoxes(lastLine, isLogicallyLastRunWrapped, logicallyLastRunRenderer);
    329329
    330330    // Now mark the line boxes as being constructed.
     
    903903                    if (hyphenated)
    904904                        bidiRuns.logicallyLastRun()->m_hasHyphen = true;
    905                     bool lastLine = end.m_obj && end.m_obj->isText() ? reachedEndOfTextRenderer(bidiRuns) : !end.m_obj;
     905                    bool isLogicallyLastRunWrapped = bidiRuns.logicallyLastRun()->m_object && bidiRuns.logicallyLastRun()->m_object->isText() ? !reachedEndOfTextRenderer(bidiRuns) : true;
    906906                    // FIXME: Clearly constructLine should just take a bidiRuns object.
    907                     lineBox = constructLine(bidiRuns.runCount(), bidiRuns.firstRun(), bidiRuns.lastRun(), firstLine, lastLine, end.m_obj && !end.m_pos ? end.m_obj : 0, bidiRuns.logicallyLastRun()->m_object);
     907                    lineBox = constructLine(bidiRuns.runCount(), bidiRuns.firstRun(), bidiRuns.lastRun(), firstLine, !end.m_obj, isLogicallyLastRunWrapped, bidiRuns.logicallyLastRun()->m_object);
    908908                    if (lineBox) {
    909909                        lineBox->setEndsWithBreak(previousLineBrokeCleanly);
Note: See TracChangeset for help on using the changeset viewer.