Changeset 136967 in webkit


Ignore:
Timestamp:
Dec 7, 2012 11:30:51 AM (11 years ago)
Author:
robert@webkit.org
Message:

REGRESSION(r127163): Content is offset to the right at rea.ru
https://bugs.webkit.org/show_bug.cgi?id=103116

Reviewed by David Hyatt.

Source/WebCore:

The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
so to ensure any child floats of the self-collapsing block only go as far as the top content edge
add the margin back in to the block's current height before placing them.

Tests: fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins.html

fast/block/margin-collapse/self-collapsing-block-with-float-child.html

  • rendering/RenderBlockLineLayout.cpp:

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

LayoutTests:

  • fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins-expected.html: Added.
  • fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins.html: Added.
  • fast/block/margin-collapse/self-collapsing-block-with-float-child-expected.html: Added.
  • fast/block/margin-collapse/self-collapsing-block-with-float-child.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136963 r136967  
     12012-12-07  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r127163): Content is offset to the right at rea.ru
     4        https://bugs.webkit.org/show_bug.cgi?id=103116
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins-expected.html: Added.
     9        * fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins.html: Added.
     10        * fast/block/margin-collapse/self-collapsing-block-with-float-child-expected.html: Added.
     11        * fast/block/margin-collapse/self-collapsing-block-with-float-child.html: Added.
     12
    1132012-12-07  Mike West  <mkwst@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r136966 r136967  
     12012-12-07  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION(r127163): Content is offset to the right at rea.ru
     4        https://bugs.webkit.org/show_bug.cgi?id=103116
     5
     6        Reviewed by David Hyatt.
     7
     8        The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
     9        so to ensure any child floats of the self-collapsing block only go as far as the top content edge
     10        add the margin back in to the block's current height before placing them.
     11
     12        Tests: fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins.html
     13               fast/block/margin-collapse/self-collapsing-block-with-float-child.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
     17
    1182012-12-07  Alexis Menard  <alexis@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r136908 r136967  
    22142214                lineInfo.incrementRunsFromLeadingWhitespace();
    22152215            }
    2216         } else if (object->isFloating())
     2216        } else if (object->isFloating()) {
     2217            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
     2218            // 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.
     2219            LayoutUnit marginOffset = (m_block->isSelfCollapsingBlock() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
     2220            LayoutUnit oldLogicalHeight = m_block->logicalHeight();
     2221            m_block->setLogicalHeight(oldLogicalHeight + marginOffset);
    22172222            m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
    2218         else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText() && !toRenderCombineText(object)->isCombined()) {
     2223            m_block->setLogicalHeight(oldLogicalHeight);
     2224        } else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText() && !toRenderCombineText(object)->isCombined()) {
    22192225            toRenderCombineText(object)->combineText();
    22202226            if (toRenderCombineText(object)->isCombined())
Note: See TracChangeset for help on using the changeset viewer.