Changeset 31734 in webkit


Ignore:
Timestamp:
Apr 8, 2008, 1:58:36 PM (17 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Antti Koivisto.

Test: fast/block/float/br-with-clear-2.html

  • rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): The existing code for handling a float-clearing <br> in incremental layout had several bugs in it: it only applied when the <br> was on the last line of the block; it assumed that the <br> was always the rightmost box on the line (which is false in right-to-left runs); and in some places it looked at the last child of the block instead of the last box on the line. Fixed these bugs.

LayoutTests:

Reviewed by Antti Koivisto.

  • fast/block/float/br-with-clear-2.html: Added.
  • platform/mac/fast/block/float/br-with-clear-2-expected.checksum: Added.
  • platform/mac/fast/block/float/br-with-clear-2-expected.png: Added.
  • platform/mac/fast/block/float/br-with-clear-2-expected.txt: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r31722 r31734  
     12008-04-08  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=18172
     6          REGRESSION (r31114-31132): Page renders structured almost horizontally (at flickr.com)
     7
     8        * fast/block/float/br-with-clear-2.html: Added.
     9        * platform/mac/fast/block/float/br-with-clear-2-expected.checksum: Added.
     10        * platform/mac/fast/block/float/br-with-clear-2-expected.png: Added.
     11        * platform/mac/fast/block/float/br-with-clear-2-expected.txt: Added.
     12
    1132008-04-08  Brady Eidson  <beidson@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r31733 r31734  
     12008-04-08  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=18172
     6          REGRESSION (r31114-31132): Page renders structured almost horizontally (at flickr.com)
     7
     8        Test: fast/block/float/br-with-clear-2.html
     9
     10        * rendering/bidi.cpp:
     11        (WebCore::RenderBlock::layoutInlineChildren): The existing code for
     12        handling a float-clearing <br> in incremental layout had several bugs in
     13        it: it only applied when the <br> was on the last line of the block; it
     14        assumed that the <br> was always the rightmost box on the line (which is
     15        false in right-to-left runs); and in some places it looked at the last
     16        child of the block instead of the last box on the line. Fixed these
     17        bugs.
     18
    1192008-04-08  Adam Roben  <aroben@apple.com>
    220
  • trunk/WebCore/rendering/bidi.cpp

    r31328 r31734  
    870870        BidiIterator end = start.position();
    871871
    872         if (!fullLayout && end.atEnd() && lastRootBox() && lastRootBox()->lastChild()->object()->isBR() && lastRootBox()->object()->lastChild()->style()->clear() != CNONE)
    873             newLine(lastRootBox()->object()->lastChild()->style()->clear());
     872        if (!fullLayout && lastRootBox() && lastRootBox()->endsWithBreak()) {
     873            // If the last line before the start line ends with a line break that clear floats,
     874            // adjust the height accordingly.
     875            // A line break can be either the first or the last object on a line, depending on its direction.
     876            RenderObject* lastObject = lastRootBox()->lastLeafChild()->object();
     877            if (!lastObject->isBR())
     878                lastObject = lastRootBox()->firstLeafChild()->object();
     879            if (lastObject->isBR()) {
     880                EClear clear = lastObject->style()->clear();
     881                if (clear != CNONE)
     882                    newLine(clear);
     883            }
     884        }
    874885
    875886        bool endLineMatched = false;
Note: See TracChangeset for help on using the changeset viewer.