Changeset 140570 in webkit


Ignore:
Timestamp:
Jan 23, 2013 12:15:12 PM (11 years ago)
Author:
robert@webkit.org
Message:

Abspos Inline block not positioned correctly in text-aligned container
https://bugs.webkit.org/show_bug.cgi?id=105695

Reviewed by Ojan Vafai.

Source/WebCore:

Inline positioned elements should still obey the text-alignment of their container
even when we don't do a line layout.

Test: fast/text/container-align-with-inlines.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::adjustPositionedBlock):
(WebCore::RenderBlock::updateStaticInlinePositionForChild):
(WebCore):

  • rendering/RenderBlock.h:

(RenderBlock):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setStaticPositions):

LayoutTests:

  • fast/text/container-align-with-inlines-expected.txt: Added.
  • fast/text/container-align-with-inlines.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140560 r140570  
     12013-01-23  Robert Hogan  <robert@webkit.org>
     2
     3        Abspos Inline block not positioned correctly in text-aligned container
     4        https://bugs.webkit.org/show_bug.cgi?id=105695
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * fast/text/container-align-with-inlines-expected.txt: Added.
     9        * fast/text/container-align-with-inlines.html: Added.
     10
    1112013-01-23  Alexis Menard  <alexis@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r140569 r140570  
     12013-01-23  Robert Hogan  <robert@webkit.org>
     2
     3        Abspos Inline block not positioned correctly in text-aligned container
     4        https://bugs.webkit.org/show_bug.cgi?id=105695
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Inline positioned elements should still obey the text-alignment of their container
     9        even when we don't do a line layout.
     10
     11        Test: fast/text/container-align-with-inlines.html
     12
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::adjustPositionedBlock):
     15        (WebCore::RenderBlock::updateStaticInlinePositionForChild):
     16        (WebCore):
     17        * rendering/RenderBlock.h:
     18        (RenderBlock):
     19        * rendering/RenderBlockLineLayout.cpp:
     20        (WebCore::setStaticPositions):
     21
    1222013-01-23  Eric Seidel  <eric@webkit.org>
    223
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r140482 r140570  
    17521752   
    17531753    LayoutUnit logicalTop = logicalHeight();
    1754     setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent(logicalTop));
     1754    updateStaticInlinePositionForChild(child, logicalTop);
    17551755
    17561756    if (!marginInfo.canCollapseWithMarginBefore()) {
     
    74097409}
    74107410
     7411void RenderBlock::updateStaticInlinePositionForChild(RenderBox* child, LayoutUnit logicalTop)
     7412{
     7413    if (child->style()->isOriginalDisplayInlineType())
     7414        setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetForLine(logicalTop, false));
     7415    else
     7416        setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent(logicalTop));
     7417}
     7418
    74117419void RenderBlock::setStaticInlinePositionForChild(RenderBox* child, LayoutUnit blockOffset, LayoutUnit inlinePosition)
    74127420{
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r140365 r140570  
    425425   
    426426    void setStaticInlinePositionForChild(RenderBox*, LayoutUnit blockOffset, LayoutUnit inlinePosition);
     427    void updateStaticInlinePositionForChild(RenderBox*, LayoutUnit logicalTop);
    427428
    428429    LayoutUnit computeStartPositionDeltaForChildAvoidingFloats(const RenderBox* child, LayoutUnit childMarginStart, RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = 0);
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r139337 r140570  
    10721072        toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
    10731073    }
    1074 
    1075     if (child->style()->isOriginalDisplayInlineType())
    1076         block->setStaticInlinePositionForChild(child, blockHeight, block->startAlignedOffsetForLine(blockHeight, false));
    1077     else
    1078         block->setStaticInlinePositionForChild(child, blockHeight, block->startOffsetForContent(blockHeight));
     1074    block->updateStaticInlinePositionForChild(child, blockHeight);
    10791075    child->layer()->setStaticBlockPosition(blockHeight);
    10801076}
Note: See TracChangeset for help on using the changeset viewer.