Changeset 150602 in webkit


Ignore:
Timestamp:
May 23, 2013 11:55:53 AM (11 years ago)
Author:
robert@webkit.org
Message:

The ellipsis in a text overflow should not avoid floats
https://bugs.webkit.org/show_bug.cgi?id=115746

Reviewed by David Hyatt.

Source/WebCore:

When placing an ellipsis for text overflow we shouldn't avoid any floats on the line.
That is to say, if there is a float in the box we overflow we should let our no-wrap text,
including the ellipsis, render inside the float just as we would if overflow was hidden but
a text-overflow rendering had not been specified.

Test: fast/css/text-overflow-ellipsis-behind-floats.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::checkLinesForTextOverflow):

LayoutTests:

  • fast/css/text-overflow-ellipsis-behind-floats-expected.html: Added.
  • fast/css/text-overflow-ellipsis-behind-floats.html: Added.
  • fast/css/text-overflow-ellipsis-full-truncate-rtl-expected.html:
  • fast/css/text-overflow-ellipsis-full-truncate-rtl.html: Change this test to expect the text to cross into the floating input element and render the ellipsis at the left extreme of the element. The previous expected rendering relied on the incorrect premise that an overflow ellipsis should avoid floated elements.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150596 r150602  
     12013-05-18  Robert Hogan  <robert@webkit.org>
     2
     3        The ellipsis in a text overflow should not avoid floats
     4        https://bugs.webkit.org/show_bug.cgi?id=115746
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/css/text-overflow-ellipsis-behind-floats-expected.html: Added.
     9        * fast/css/text-overflow-ellipsis-behind-floats.html: Added.
     10        * fast/css/text-overflow-ellipsis-full-truncate-rtl-expected.html:
     11        * fast/css/text-overflow-ellipsis-full-truncate-rtl.html:
     12          Change this test to expect the text to cross into the floating input element
     13          and render the ellipsis at the left extreme of the element. The previous expected
     14          rendering relied on the incorrect premise that an overflow ellipsis should avoid
     15          floated elements.
     16
    1172013-05-23  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/LayoutTests/fast/css/text-overflow-ellipsis-full-truncate-rtl-expected.html

    r150065 r150602  
    1515<body>
    1616<p dir='ltr'>This tests that ellipsis is placed correctly, when full truncation takes over in an rtl flow.</p>
    17 <div style='width:582px;'><input type="text" size='74'>consectetur adipisicing elit, sed do eiusmod</div>
     17<div style='width:582px;'><input type="text" size='74'>consectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elit, sed do eiusmod</div>
    1818</body>
    1919</div>
  • trunk/LayoutTests/fast/css/text-overflow-ellipsis-full-truncate-rtl.html

    r150065 r150602  
    1515<body>
    1616<p dir='ltr'>This tests that ellipsis is placed correctly, when full truncation takes over in an rtl flow.</p>
    17 <div style='width:582px;'><input type="text" size='74'><span>Lorem ipsum dolor sit</span>consectetur adipisicing elit</div>
     17<div style='width:582px;'><input type="text" size='74'><span>Lorem ipsum dolor sit</span>consectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elitconsectetur adipisicing elit</div>
    1818</body>
    1919</div>
  • trunk/Source/WebCore/ChangeLog

    r150590 r150602  
     12013-05-18  Robert Hogan  <robert@webkit.org>
     2
     3        The ellipsis in a text overflow should not avoid floats
     4        https://bugs.webkit.org/show_bug.cgi?id=115746
     5
     6        Reviewed by David Hyatt.
     7
     8        When placing an ellipsis for text overflow we shouldn't avoid any floats on the line.
     9        That is to say, if there is a float in the box we overflow we should let our no-wrap text,
     10        including the ellipsis, render inside the float just as we would if overflow was hidden but
     11        a text-overflow rendering had not been specified.
     12
     13        Test: fast/css/text-overflow-ellipsis-behind-floats.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::checkLinesForTextOverflow):
     17
    1182013-05-23  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    219
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r150478 r150602  
    34983498        // FIXME: Use pixelSnappedLogicalRightOffsetForLine instead of snapping it ourselves once the column workaround in said method has been fixed.
    34993499        // https://bugs.webkit.org/show_bug.cgi?id=105461
    3500         int blockRightEdge = snapSizeToPixel(logicalRightOffsetForLine(curr->lineTop(), firstLine), curr->x());
    3501         int blockLeftEdge = pixelSnappedLogicalLeftOffsetForLine(curr->lineTop(), firstLine);
     3500        int blockRightEdge = snapSizeToPixel(ltr ? logicalRightOffsetForContent(curr->lineTop()) : logicalRightOffsetForLine(curr->lineTop(), firstLine), curr->x());
     3501        int blockLeftEdge = ltr ? pixelSnappedLogicalLeftOffsetForLine(curr->lineTop(), firstLine).toInt() : snapSizeToPixel(logicalLeftOffsetForContent(curr->lineTop()), curr->x());
    35023502        int lineBoxEdge = ltr ? snapSizeToPixel(curr->x() + curr->logicalWidth(), curr->x()) : snapSizeToPixel(curr->x(), 0);
    35033503        if ((ltr && lineBoxEdge > blockRightEdge) || (!ltr && lineBoxEdge < blockLeftEdge)) {
     
    35133513
    35143514                float logicalLeft = 0; // We are only intersted in the delta from the base position.
    3515                 float truncatedWidth = pixelSnappedLogicalRightOffsetForLine(curr->lineTop(), firstLine);
     3515                float truncatedWidth = snapSizeToPixel(logicalRightOffsetForContent(curr->lineTop()), curr->x());
    35163516                updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
    35173517                if (ltr)
Note: See TracChangeset for help on using the changeset viewer.