Changeset 140447 in webkit


Ignore:
Timestamp:
Jan 22, 2013, 12:03:44 PM (12 years ago)
Author:
tony@chromium.org
Message:

Merge r139337 to M25.

REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements
https://bugs.webkit.org/show_bug.cgi?id=106374

Reviewed by David Hyatt.

r136397 treated any self-collapsing block that had a clearance delta as though it was clearing a float, but
blocks that avoid floats can get a clearance delta too. So just ensure there is clearance on the block when deciding
whether we need to add the margin back in before placing the float.

TBR=tony@chromium.org
Review URL: https://codereview.chromium.org/12039022

Location:
branches/chromium/1364
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/chromium/1364/LayoutTests/ChangeLog

    r139577 r140447  
     12013-01-10  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements
     4        https://bugs.webkit.org/show_bug.cgi?id=106374
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child-expected.txt: Added.
     9        * fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html: Added.
     10
    1112013-01-09  Tien-Ren Chen  <trchen@chromium.org>
    212
  • branches/chromium/1364/Source/WebCore/ChangeLog

    r139577 r140447  
     12013-01-10  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements
     4        https://bugs.webkit.org/show_bug.cgi?id=106374
     5
     6        Reviewed by David Hyatt.
     7
     8        r136397 treated any self-collapsing block that had a clearance delta as though it was clearing a float, but
     9        blocks that avoid floats can get a clearance delta too. So just ensure there is clearance on the block when deciding
     10        whether we need to add the margin back in before placing the float.
     11
     12        Test: fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html
     13
     14        * rendering/RenderBlockLineLayout.cpp:
     15        (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
     16
    1172013-01-09  Tien-Ren Chen  <trchen@chromium.org>
    218
  • branches/chromium/1364/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r139363 r140447  
    22842284            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
    22852285            // 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.
    2286             LayoutUnit marginOffset = (m_block->isSelfCollapsingBlock() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
     2286            LayoutUnit marginOffset = (m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
    22872287            LayoutUnit oldLogicalHeight = m_block->logicalHeight();
    22882288            m_block->setLogicalHeight(oldLogicalHeight + marginOffset);
Note: See TracChangeset for help on using the changeset viewer.