Changeset 142659 in webkit


Ignore:
Timestamp:
Feb 12, 2013 1:06:07 PM (11 years ago)
Author:
robert@webkit.org
Message:

REGRESSION(r136967): Combination of float and clear yields to bad layout
https://bugs.webkit.org/show_bug.cgi?id=109476

Reviewed by Levi Weintraub.

Source/WebCore:

Test: fast/block/margin-collapse/self-collapsing-block-with-float-children.html

The change made at http://trac.webkit.org/changeset/136967 only needs to worry about the first floated
child of a self-collapsing block. The ones that follow are not affected by its margins.

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):

LayoutTests:

  • fast/block/margin-collapse/self-collapsing-block-with-float-children-expected.txt: Added.
  • fast/block/margin-collapse/self-collapsing-block-with-float-children.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142658 r142659  
     12013-02-12  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r136967): Combination of float and clear yields to bad layout
     4        https://bugs.webkit.org/show_bug.cgi?id=109476
     5
     6        Reviewed by Levi Weintraub.
     7
     8        * fast/block/margin-collapse/self-collapsing-block-with-float-children-expected.txt: Added.
     9        * fast/block/margin-collapse/self-collapsing-block-with-float-children.html: Added.
     10
    1112013-02-12  Emil A Eklund  <eae@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r142657 r142659  
     12013-02-12  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r136967): Combination of float and clear yields to bad layout
     4        https://bugs.webkit.org/show_bug.cgi?id=109476
     5
     6        Reviewed by Levi Weintraub.
     7
     8        Test: fast/block/margin-collapse/self-collapsing-block-with-float-children.html
     9
     10        The change made at http://trac.webkit.org/changeset/136967 only needs to worry about the first floated
     11        child of a self-collapsing block. The ones that follow are not affected by its margins.
     12
     13        * rendering/RenderBlockLineLayout.cpp:
     14        (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
     15
    1162013-02-12  Levi Weintraub  <leviw@chromium.org>
    217
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r142434 r142659  
    22822282        } else if (object->isFloating()) {
    22832283            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
    2284             // so in order to place this child float at the top content edge of the self-collapsing block add the margin back in before placement.
    2285             LayoutUnit marginOffset = (m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
     2284            // so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
     2285            LayoutUnit marginOffset = (!object->previousSibling() && m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
    22862286            LayoutUnit oldLogicalHeight = m_block->logicalHeight();
    22872287            m_block->setLogicalHeight(oldLogicalHeight + marginOffset);
Note: See TracChangeset for help on using the changeset viewer.