Changeset 100949 in webkit


Ignore:
Timestamp:
Nov 21, 2011 1:06:14 PM (12 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: empty-inline-003.htm fails
https://bugs.webkit.org/show_bug.cgi?id=72638

Reviewed by Ryosuke Niwa.

Source/WebCore:

Empty inline elements need to share their inline height with siblings.

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::inlineFlowRequiresLineBox): In strict mode, add a LineBox for an empty element if it is
going to affect the line-height.
(WebCore::requiresLineBox): Pass LineInfo to inlineFlowRequiresLineBox
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Pass LineInfo to inlineFlowRequiresLineBox

LayoutTests:

  • css2.1/20110323/empty-inline-001.htm: Added.
  • css2.1/20110323/empty-inline-002.htm: Added.
  • css2.1/20110323/empty-inline-003.htm: Added.
  • fast/css/empty-inline-003-quirksmode-expected.png: Result can cover all platforms as there is no text apart from the period.
  • fast/css/empty-inline-003-quirksmode-expected.txt: ditto
  • fast/css/empty-inline-003-quirksmode.htm: empty-inline-003.htm should only pass in strict mode, this ensures it 'fails' in quirks mode.
  • fast/css/empty-inline-line-height-first-line-expected.png: Added.
  • fast/css/empty-inline-line-height-first-line-expected.txt: Added.
  • fast/css/empty-inline-line-height-first-line-quirksmode-expected.png: Added.
  • fast/css/empty-inline-line-height-first-line-quirksmode-expected.txt: Result can cover all platforms as there is no text apart from the period.
  • fast/css/empty-inline-line-height-first-line-quirksmode.htm: Like empty-inline-003.htm, empty-inline-line-height-first-line.htm should also fail in quirks mode.
  • fast/css/empty-inline-line-height-first-line.htm: Like empty-inline-003.htm but ensures first-line style is respected for line-height in empty elements.
  • platform/chromium/css2.1/20110323/empty-inline-001-expected.png: Added.
  • platform/chromium/css2.1/20110323/empty-inline-001-expected.txt: Added.
  • platform/chromium/css2.1/20110323/empty-inline-002-expected.png: Added.
  • platform/chromium/css2.1/20110323/empty-inline-002-expected.txt: Added.
  • platform/chromium/css2.1/20110323/empty-inline-003-expected.png: Added.
  • platform/chromium/css2.1/20110323/empty-inline-003-expected.txt: Added.
Location:
trunk
Files:
18 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100945 r100949  
     12011-11-17  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: empty-inline-003.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=72638
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * css2.1/20110323/empty-inline-001.htm: Added.
     9        * css2.1/20110323/empty-inline-002.htm: Added.
     10        * css2.1/20110323/empty-inline-003.htm: Added.
     11        * fast/css/empty-inline-003-quirksmode-expected.png: Result can
     12          cover all platforms as there is no text apart from the period.
     13        * fast/css/empty-inline-003-quirksmode-expected.txt: ditto
     14        * fast/css/empty-inline-003-quirksmode.htm: empty-inline-003.htm should only pass in
     15          strict mode, this ensures it 'fails' in quirks mode.
     16        * fast/css/empty-inline-line-height-first-line-expected.png: Added.
     17        * fast/css/empty-inline-line-height-first-line-expected.txt: Added.
     18        * fast/css/empty-inline-line-height-first-line-quirksmode-expected.png: Added.
     19        * fast/css/empty-inline-line-height-first-line-quirksmode-expected.txt: Result can
     20          cover all platforms as there is no text apart from the period.
     21        * fast/css/empty-inline-line-height-first-line-quirksmode.htm: Like
     22          empty-inline-003.htm, empty-inline-line-height-first-line.htm should also fail in quirks mode.
     23        * fast/css/empty-inline-line-height-first-line.htm: Like empty-inline-003.htm but
     24          ensures first-line style is respected for line-height in empty elements.
     25        * platform/chromium/css2.1/20110323/empty-inline-001-expected.png: Added.
     26        * platform/chromium/css2.1/20110323/empty-inline-001-expected.txt: Added.
     27        * platform/chromium/css2.1/20110323/empty-inline-002-expected.png: Added.
     28        * platform/chromium/css2.1/20110323/empty-inline-002-expected.txt: Added.
     29        * platform/chromium/css2.1/20110323/empty-inline-003-expected.png: Added.
     30        * platform/chromium/css2.1/20110323/empty-inline-003-expected.txt: Added.
     31
    1322011-11-21  Adam Klein  <adamk@chromium.org>
    233
  • trunk/Source/WebCore/ChangeLog

    r100947 r100949  
     12011-11-17  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: empty-inline-003.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=72638
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Empty inline elements need to share their inline height with siblings.
     9
     10        * rendering/RenderBlockLineLayout.cpp:
     11        (WebCore::inlineFlowRequiresLineBox): In strict mode, add a LineBox for an empty element if it is
     12        going to affect the line-height.
     13        (WebCore::requiresLineBox): Pass LineInfo to inlineFlowRequiresLineBox
     14        (WebCore::RenderBlock::LineBreaker::nextLineBreak): Pass LineInfo to inlineFlowRequiresLineBox
     15
    1162011-11-21  Adrienne Walker  <enne@google.com>
    217
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r100048 r100949  
    17971797}
    17981798
    1799 static bool inlineFlowRequiresLineBox(RenderInline* flow)
     1799static bool inlineFlowRequiresLineBox(RenderInline* flow, const LineInfo& lineInfo)
    18001800{
    18011801    // FIXME: Right now, we only allow line boxes for inlines that are truly empty.
    18021802    // We need to fix this, though, because at the very least, inlines containing only
    18031803    // ignorable whitespace should should also have line boxes.
     1804    if (!flow->document()->inQuirksMode() && flow->style(lineInfo.isFirstLine())->lineHeight() != flow->parent()->style(lineInfo.isFirstLine())->lineHeight())
     1805        return true;
     1806
    18041807    return !flow->firstChild() && flow->hasInlineDirectionBordersPaddingOrMargin();
    18051808}
     
    18101813        return false;
    18111814
    1812     if (it.m_obj->isRenderInline() && !inlineFlowRequiresLineBox(toRenderInline(it.m_obj)))
     1815    if (it.m_obj->isRenderInline() && !inlineFlowRequiresLineBox(toRenderInline(it.m_obj), lineInfo))
    18131816        return false;
    18141817
     
    21822185            // If this object is at the start of the line, we need to behave like list markers and
    21832186            // start ignoring spaces.
    2184             if (inlineFlowRequiresLineBox(flowBox)) {
     2187            if (inlineFlowRequiresLineBox(flowBox, lineInfo)) {
    21852188                lineInfo.setEmpty(false, m_block, &width);
    21862189                if (ignoringSpaces) {
Note: See TracChangeset for help on using the changeset viewer.