Changeset 139337 in webkit


Ignore:
Timestamp:
Jan 10, 2013, 10:39:17 AM (12 years ago)
Author:
robert@webkit.org
Message:

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.

Source/WebCore:

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.

Test: fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html

  • rendering/RenderBlockLineLayout.cpp:

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

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139335 r139337  
     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-10  Dimitri Glazkov  <dglazkov@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r139334 r139337  
     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-10  Alexander Pavlov  <apavlov@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

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