Changeset 152793 in webkit


Ignore:
Timestamp:
Jul 17, 2013 11:46:39 AM (11 years ago)
Author:
akling@apple.com
Message:

Wrong linebox height, when block element parent has vertical-align property defined.
https://bugs.webkit.org/show_bug.cgi?id=118245

Patch by Zalan Bujtas <Alan Bujtas> on 2013-07-17
Reviewed by David Hyatt.

Do not push the current element to the next, when it is still considered empty, even with
some object(s) in front. Behave as if it was actually empty.
Inline elements like <span></span> generate such lines.

Source/WebCore:

Test: fast/css/empty-span-with-parent-div-and-vertical-align.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::LineBreaker::nextSegmentBreak):

LayoutTests:

  • fast/css/empty-span-with-parent-div-and-vertical-align-expected.html: Added.
  • fast/css/empty-span-with-parent-div-and-vertical-align.html: Added.
  • platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png: Rebased.
  • platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.txt: Rebased.
  • platform/mac/tables/mozilla/marvin/backgr_index-expected.png: Rebased.
  • platform/mac/tables/mozilla/marvin/backgr_index-expected.txt: Rebased.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152790 r152793  
     12013-07-17  Zalan Bujtas  <zalan@apple.com>
     2
     3        Wrong linebox height, when block element parent has vertical-align property defined.
     4        https://bugs.webkit.org/show_bug.cgi?id=118245
     5
     6        Reviewed by David Hyatt.
     7
     8        Do not push the current element to the next, when it is still considered empty, even with
     9        some object(s) in front. Behave as if it was actually empty.
     10        Inline elements like <span></span> generate such lines.
     11
     12        * fast/css/empty-span-with-parent-div-and-vertical-align-expected.html: Added.
     13        * fast/css/empty-span-with-parent-div-and-vertical-align.html: Added.
     14        * platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png: Rebased.
     15        * platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.txt: Rebased.
     16        * platform/mac/tables/mozilla/marvin/backgr_index-expected.png: Rebased.
     17        * platform/mac/tables/mozilla/marvin/backgr_index-expected.txt: Rebased.
     18
    1192013-07-17  Alex Christensen  <achristensen@apple.com>
    220
  • trunk/LayoutTests/platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.txt

    r150290 r152793  
    77        RenderBlock {UL} at (0,0) size 190x26
    88          RenderListItem {LI} at (40,0) size 150x26
    9             RenderListMarker at (0,0) size 7x18: bullet
     9            RenderListMarker at (-17,8) size 7x18: bullet
    1010            RenderInline {A} at (0,0) size 201x18
    1111              RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/marvin/backgr_index-expected.txt

    r149210 r152793  
    1 layer at (0,0) size 827x1744
     1layer at (0,0) size 827x1729
    22  RenderView at (0,0) size 785x585
    3 layer at (0,0) size 785x1744
    4   RenderBlock {HTML} at (0,0) size 785x1744
    5     RenderBody {BODY} at (8,17) size 769x1714 [color=#00FF00] [bgcolor=#333333]
     3layer at (0,0) size 785x1729
     4  RenderBlock {HTML} at (0,0) size 785x1729
     5    RenderBody {BODY} at (8,17) size 769x1699 [color=#00FF00] [bgcolor=#333333]
    66      RenderBlock {H1} at (0,0) size 769x30
    77        RenderText {#text} at (0,0) size 528x30
     
    3030        RenderText {#text} at (0,0) size 392x15
    3131          text run at (0,0) width 392: "The images used as backgrounds are the following:"
    32       RenderBlock {UL} at (0,260) size 769x745
     32      RenderBlock {UL} at (0,260) size 769x730
    3333        RenderListItem {LI} at (40,0) size 729x33
    3434          RenderListMarker at (-16,18) size 6x15: bullet
     
    3939          RenderImage {IMG} at (0,0) size 30x80
    4040          RenderText {#text} at (0,0) size 0x0
    41         RenderListItem {LI} at (40,116) size 729x629
    42           RenderListMarker at (-16,0) size 6x15: bullet
    43           RenderImage {IMG} at (0,15) size 779x611
     41        RenderListItem {LI} at (40,116) size 729x614
     42          RenderListMarker at (-16,599) size 6x15: bullet
     43          RenderImage {IMG} at (0,0) size 779x611
    4444          RenderText {#text} at (0,0) size 0x0
    45       RenderBlock {P} at (0,1018) size 769x15
     45      RenderBlock {P} at (0,1003) size 769x15
    4646        RenderText {#text} at (0,0) size 336x15
    4747          text run at (0,0) width 336: "They are in GIF format, with transparency."
    48       RenderBlock {P} at (0,1046) size 769x30
     48      RenderBlock {P} at (0,1031) size 769x30
    4949        RenderText {#text} at (0,0) size 760x30
    5050          text run at (0,0) width 760: "Each color band in the rainbow backgrounds is 20 pixels wide. Each stripe within the color band"
    5151          text run at (0,15) width 152: "is two pixels wide."
    52       RenderBlock {P} at (0,1089) size 769x15
     52      RenderBlock {P} at (0,1074) size 769x15
    5353        RenderText {#text} at (0,0) size 728x15
    5454          text run at (0,0) width 728: "The aqua and purple band is 10 pixels wide. Each stripe within the band is two pixels wide."
    55       RenderBlock {P} at (0,1117) size 769x15
     55      RenderBlock {P} at (0,1102) size 769x15
    5656        RenderText {#text} at (0,0) size 744x15
    5757          text run at (0,0) width 744: "Many image background rules in this test suite are backed up with a 'black' background color."
    58       RenderBlock {P} at (0,1145) size 769x60
     58      RenderBlock {P} at (0,1130) size 769x60
    5959        RenderText {#text} at (0,0) size 232x15
    6060          text run at (0,0) width 232: "This test suite assumes that "
     
    7676        RenderText {#text} at (56,45) size 8x15
    7777          text run at (56,45) width 8: "."
    78       RenderBlock {H2} at (0,1221) size 769x23
     78      RenderBlock {H2} at (0,1206) size 769x23
    7979        RenderText {#text} at (0,0) size 204x23
    8080          text run at (0,0) width 204: "Table of Contents"
    81       RenderBlock {OL} at (0,1260) size 769x454
     81      RenderBlock {OL} at (0,1245) size 769x454
    8282        RenderListItem {LI} at (40,0) size 729x105
    8383          RenderBlock (anonymous) at (0,0) size 729x15
  • trunk/Source/WebCore/ChangeLog

    r152788 r152793  
     12013-07-17  Zalan Bujtas  <zalan@apple.com>
     2
     3        Wrong linebox height, when block element parent has vertical-align property defined.
     4        https://bugs.webkit.org/show_bug.cgi?id=118245
     5
     6        Reviewed by David Hyatt.
     7
     8        Do not push the current element to the next, when it is still considered empty, even with
     9        some object(s) in front. Behave as if it was actually empty.
     10        Inline elements like <span></span> generate such lines.
     11
     12        Test: fast/css/empty-span-with-parent-div-and-vertical-align.html
     13
     14        * rendering/RenderBlockLineLayout.cpp:
     15        (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
     16
    1172013-07-17  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r152313 r152793  
    35053505#endif
    35063506
    3507     if (lBreak == resolver.position() && (!lBreak.m_obj || !lBreak.m_obj->isBR()) && segmentAllowsOverflow) {
    3508         // we just add as much as possible
    3509         if (blockStyle->whiteSpace() == PRE && !current.m_pos) {
    3510             lBreak.moveTo(last, last->isText() ? last->length() : 0);
    3511         } else if (lBreak.m_obj) {
    3512             // Don't ever break in the middle of a word if we can help it.
    3513             // There's no room at all. We just have to be on this line,
    3514             // even though we'll spill out.
    3515             lBreak.moveTo(current.m_obj, current.m_pos);
    3516         }
    3517     }
    3518 
    3519     // make sure we consume at least one char/object.
    3520     if (lBreak == resolver.position() && segmentAllowsOverflow)
    3521         lBreak.increment();
     3507    if (segmentAllowsOverflow) {
     3508        if (lBreak == resolver.position()) {
     3509            if (!lBreak.m_obj || !lBreak.m_obj->isBR()) {
     3510                // we just add as much as possible
     3511                if (blockStyle->whiteSpace() == PRE && !current.m_pos) {
     3512                    lBreak.moveTo(last, last->isText() ? last->length() : 0);
     3513                } else if (lBreak.m_obj) {
     3514                    // Don't ever break in the middle of a word if we can help it.
     3515                    // There's no room at all. We just have to be on this line,
     3516                    // even though we'll spill out.
     3517                    lBreak.moveTo(current.m_obj, current.m_pos);
     3518                }
     3519            }
     3520            // make sure we consume at least one char/object.
     3521            if (lBreak == resolver.position())
     3522                lBreak.increment();
     3523        } else if (!width.committedWidth() && (!current.m_obj || !current.m_obj->isBR()) && !current.m_pos) {
     3524            // Do not push the current object to the next line, when this line has some content, but it is still considered empty.
     3525            // Empty inline elements like <span></span> can produce such lines and now we just ignore these break opportunities
     3526            // at the start of a line, if no width has been committed yet.
     3527            // Behave as if it was actually empty and consume at least one object.
     3528            lBreak.increment();
     3529        }
     3530    }
    35223531
    35233532    // Sanity check our midpoints.
     
    36093618                float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
    36103619
    3611                 float logicalLeft = 0; // We are only intersted in the delta from the base position.
     3620                float logicalLeft = 0; // We are only interested in the delta from the base position.
    36123621                float truncatedWidth = pixelSnappedLogicalRightOffsetForLine(curr->lineTop(), firstLine);
    36133622                updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
Note: See TracChangeset for help on using the changeset viewer.