Changeset 148453 in webkit


Ignore:
Timestamp:
Apr 15, 2013 11:23:37 AM (11 years ago)
Author:
robert@webkit.org
Message:

An inline element with an absolutely positioned child does not correctly calculate/render padding and margin
https://bugs.webkit.org/show_bug.cgi?id=47554

Reviewed by David Hyatt.

Source/WebCore:

When looking for padding/margin to add from the start of a child's parent skip past any leading positioned siblings as
we don't add the padding/margin of the common parent when skipping past them in |skipLeadingWhitespace|. We
don't need to worry about the case of trailing positioned objects as we will account for their parent's
border/margin/padding when we encounter them in |nextSegmentBreak|.

Test: fast/inline/padding-before-leading-positioned-element-contributes-width.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::previousInFlowSibling):
(WebCore):
(WebCore::inlineLogicalWidth):

LayoutTests:

  • fast/inline/padding-before-leading-positioned-element-contributes-width-expected.txt: Added.
  • fast/inline/padding-before-leading-positioned-element-contributes-width.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148452 r148453  
     12013-04-15  Robert Hogan  <robert@webkit.org>
     2
     3        An inline element with an absolutely positioned child does not correctly calculate/render padding and margin
     4        https://bugs.webkit.org/show_bug.cgi?id=47554
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/inline/padding-before-leading-positioned-element-contributes-width-expected.txt: Added.
     9        * fast/inline/padding-before-leading-positioned-element-contributes-width.html: Added.
     10
    1112013-04-15  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r148447 r148453  
     12013-04-15  Robert Hogan  <robert@webkit.org>
     2
     3        An inline element with an absolutely positioned child does not correctly calculate/render padding and margin
     4        https://bugs.webkit.org/show_bug.cgi?id=47554
     5
     6        Reviewed by David Hyatt.
     7
     8        When looking for padding/margin to add from the start of a child's parent skip past any leading positioned siblings as
     9        we don't add the padding/margin of the common parent when skipping past them in |skipLeadingWhitespace|. We
     10        don't need to worry about the case of trailing positioned objects as we will account for their parent's
     11        border/margin/padding when we encounter them in |nextSegmentBreak|.
     12
     13        Test: fast/inline/padding-before-leading-positioned-element-contributes-width.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::previousInFlowSibling):
     17        (WebCore):
     18        (WebCore::inlineLogicalWidth):
     19
    1202013-04-15  peavo@outlook.com  <peavo@outlook.com>
    221
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r148367 r148453  
    351351}
    352352
     353static RenderObject* previousInFlowSibling(RenderObject* child)
     354{
     355    child = child->previousSibling();
     356    while (child && child->isOutOfFlowPositioned())
     357        child = child->previousSibling();
     358    return child;
     359}
     360
    353361static LayoutUnit inlineLogicalWidth(RenderObject* child, bool start = true, bool end = true)
    354362{
     
    359367        RenderInline* parentAsRenderInline = toRenderInline(parent);
    360368        if (!isEmptyInline(parentAsRenderInline)) {
    361             if (start && shouldAddBorderPaddingMargin(child->previousSibling(), start))
     369            if (start && shouldAddBorderPaddingMargin(previousInFlowSibling(child), start))
    362370                extraWidth += borderPaddingMarginStart(parentAsRenderInline);
    363371            if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end))
Note: See TracChangeset for help on using the changeset viewer.