Changeset 93621 in webkit


Ignore:
Timestamp:
Aug 23, 2011 12:07:59 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r93616.
http://trac.webkit.org/changeset/93616
https://bugs.webkit.org/show_bug.cgi?id=66796

"causes fast/css/absolute-child-with-percent-height-inside-
relative-parent.html to fail" (Requested by mwenge2 on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-08-23

Source/WebCore:

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::adjustPositionedBlock):

  • rendering/RenderBlock.h:
  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
(WebCore::setStaticPositions):
(WebCore::RenderBlock::LineBreaker::nextLineBreak):

LayoutTests:

  • fast/inline/absolute-positioned-block-in-centred-block-expected.png: Removed.
  • fast/inline/absolute-positioned-block-in-centred-block-expected.txt: Removed.
  • fast/inline/absolute-positioned-block-in-centred-block.html: Removed.
  • fast/inline/absolute-positioned-inline-in-centred-block-expected.png: Removed.
  • fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: Removed.
  • fast/inline/absolute-positioned-inline-in-centred-block.html: Removed.
  • platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.png:
  • platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt:
Location:
trunk
Files:
6 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93616 r93621  
     12011-08-23  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r93616.
     4        http://trac.webkit.org/changeset/93616
     5        https://bugs.webkit.org/show_bug.cgi?id=66796
     6
     7        "causes fast/css/absolute-child-with-percent-height-inside-
     8        relative-parent.html to fail" (Requested by mwenge2 on
     9        #webkit).
     10
     11        * fast/inline/absolute-positioned-block-in-centred-block-expected.png: Removed.
     12        * fast/inline/absolute-positioned-block-in-centred-block-expected.txt: Removed.
     13        * fast/inline/absolute-positioned-block-in-centred-block.html: Removed.
     14        * fast/inline/absolute-positioned-inline-in-centred-block-expected.png: Removed.
     15        * fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: Removed.
     16        * fast/inline/absolute-positioned-inline-in-centred-block.html: Removed.
     17        * platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.png:
     18        * platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt:
     19
    1202011-07-25  Robert Hogan  <robert@webkit.org>
    221
  • trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt

    r93616 r93621  
    1515            RenderText {#text} at (0,0) size 277x19
    1616              text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog"
    17 layer at (162,37) size 277x20
    18   RenderBlock (positioned) {SPAN} at (162,37) size 277x20
     17layer at (1,37) size 277x20
     18  RenderBlock (positioned) {SPAN} at (1,37) size 277x20
    1919    RenderText {#text} at (0,0) size 277x19
    2020      text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog"
  • trunk/Source/WebCore/ChangeLog

    r93616 r93621  
     12011-08-23  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r93616.
     4        http://trac.webkit.org/changeset/93616
     5        https://bugs.webkit.org/show_bug.cgi?id=66796
     6
     7        "causes fast/css/absolute-child-with-percent-height-inside-
     8        relative-parent.html to fail" (Requested by mwenge2 on
     9        #webkit).
     10
     11        * rendering/RenderBlock.cpp:
     12        (WebCore::RenderBlock::adjustPositionedBlock):
     13        * rendering/RenderBlock.h:
     14        * rendering/RenderBlockLineLayout.cpp:
     15        (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
     16        (WebCore::setStaticPositions):
     17        (WebCore::RenderBlock::LineBreaker::nextLineBreak):
     18
    1192011-07-25  Robert Hogan  <robert@webkit.org>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r93616 r93621  
    14761476    RenderLayer* childLayer = child->layer();
    14771477       
    1478     childLayer->setStaticInlinePosition(startAlignedOffsetForBlock(logicalHeight(), false));
     1478    childLayer->setStaticInlinePosition(borderAndPaddingStart());
    14791479
    14801480    LayoutUnit logicalTop = logicalHeight();
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r93616 r93621  
    130130    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
    131131    LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : logicalRightOffsetForLine(position, firstLine); }
    132     LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool firstLine);
    133     LayoutUnit startAlignedOffsetForBlock(LayoutUnit position, bool firstLine);
    134132
    135133    virtual VisiblePosition positionForPoint(const LayoutPoint&);
     
    225223    LayoutUnit collapsedMarginAfterForChild(RenderBox* child) const;
    226224
    227     void updateLogicalWidthForAlignment(const ETextAlign&, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
    228 
    229225    virtual void updateFirstLetter();
    230226
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r93616 r93621  
    550550}
    551551
    552 void RenderBlock::updateLogicalWidthForAlignment(const ETextAlign& textAlign, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount)
    553 {
    554     // Armed with the total width of the line (without justification),
    555     // we now examine our text-align property in order to determine where to position the
    556     // objects horizontally. The total width of the line can be increased if we end up
    557     // justifying text.
    558     switch (textAlign) {
    559     case LEFT:
    560     case WEBKIT_LEFT:
    561         updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    562         break;
    563     case JUSTIFY:
    564         adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, availableLogicalWidth);
    565         if (expansionOpportunityCount) {
    566             if (trailingSpaceRun) {
    567                 totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth();
    568                 trailingSpaceRun->m_box->setLogicalWidth(0);
    569             }
    570             break;
    571         }
    572         // fall through
    573     case TAAUTO:
    574         // for right to left fall through to right aligned
    575         if (style()->isLeftToRightDirection()) {
    576             if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun)
    577                 trailingSpaceRun->m_box->setLogicalWidth(max<float>(0, trailingSpaceRun->m_box->logicalWidth() - totalLogicalWidth + availableLogicalWidth));
    578             break;
    579         }
    580     case RIGHT:
    581     case WEBKIT_RIGHT:
    582         updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    583         break;
    584     case CENTER:
    585     case WEBKIT_CENTER:
    586         updateLogicalWidthForCenterAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    587         break;
    588     case TASTART:
    589         if (style()->isLeftToRightDirection())
    590             updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    591         else
    592             updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    593         break;
    594     case TAEND:
    595         if (style()->isLeftToRightDirection())
    596             updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    597         else
    598             updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
    599         break;
    600     }
    601 }
    602 
    603552void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, const LineInfo& lineInfo, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd,
    604553                                                         GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache)
     
    657606    }
    658607
    659     updateLogicalWidthForAlignment(textAlign, trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth, expansionOpportunityCount);
     608    // Armed with the total width of the line (without justification),
     609    // we now examine our text-align property in order to determine where to position the
     610    // objects horizontally.  The total width of the line can be increased if we end up
     611    // justifying text.
     612    switch (textAlign) {
     613        case LEFT:
     614        case WEBKIT_LEFT:
     615            updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     616            break;
     617        case JUSTIFY:
     618            adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, availableLogicalWidth);
     619            if (expansionOpportunityCount) {
     620                if (trailingSpaceRun) {
     621                    totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth();
     622                    trailingSpaceRun->m_box->setLogicalWidth(0);
     623                }
     624                break;
     625            }
     626            // fall through
     627        case TAAUTO:
     628            // for right to left fall through to right aligned
     629            if (style()->isLeftToRightDirection()) {
     630                if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun)
     631                    trailingSpaceRun->m_box->setLogicalWidth(max<float>(0, trailingSpaceRun->m_box->logicalWidth() - totalLogicalWidth + availableLogicalWidth));
     632                break;
     633            }
     634        case RIGHT:
     635        case WEBKIT_RIGHT:
     636            updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     637            break;
     638        case CENTER:
     639        case WEBKIT_CENTER:
     640            updateLogicalWidthForCenterAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     641            break;
     642        case TASTART:
     643            if (style()->isLeftToRightDirection())
     644                updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     645            else
     646                updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     647            break;
     648        case TAEND:
     649            if (style()->isLeftToRightDirection())
     650                updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     651            else
     652                updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
     653            break;
     654    }
    660655
    661656    computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth);
     
    718713        // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
    719714        // inline so that we can obtain the value later.
    720         toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
     715        toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
    721716        toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
    722717    }
    723718
    724719    if (child->style()->isOriginalDisplayInlineType())
    725         child->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
     720        child->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
    726721    else
    727         child->layer()->setStaticInlinePosition(block->startAlignedOffsetForBlock(blockHeight, false));
     722        child->layer()->setStaticInlinePosition(block->borderAndPaddingStart());
    728723    child->layer()->setStaticBlockPosition(blockHeight);
    729724}
     
    20502045            bool isInlineType = box->style()->isOriginalDisplayInlineType();
    20512046            if (!isInlineType)
    2052                 box->layer()->setStaticInlinePosition(m_block->startAlignedOffsetForBlock(m_block->logicalHeight(), false));
     2047                box->layer()->setStaticInlinePosition(m_block->borderAndPaddingStart());
    20532048            else  {
    20542049                // If our original display was an INLINE type, then we can go ahead
     
    25952590}
    25962591
    2597 LayoutUnit RenderBlock::startAlignedOffsetForBlock(LayoutUnit position, bool firstLine)
    2598 {
    2599     ETextAlign textAlign = style()->textAlign();
    2600 
    2601     if (textAlign == TAAUTO)
    2602         return borderAndPaddingStart();
    2603 
    2604     LayoutUnit lineOffset = startAlignedOffsetForLine(position, firstLine);
    2605 
    2606     // For block flows, unlike inlines, the offset is given from the point at which the
    2607     // flow starts. So if the flow is RTL, flip the offset to represent units from the right.
    2608     if (!style()->isLeftToRightDirection())
    2609         lineOffset = logicalWidth() - lineOffset;
    2610     return lineOffset;
    2611 }
    2612 
    2613 LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
    2614 {
    2615     ETextAlign textAlign = style()->textAlign();
    2616 
    2617     if (textAlign == TAAUTO)
    2618         return startOffsetForLine(position, firstLine);
    2619 
    2620     // updateLogicalWidthForAlignment() handles the direction of the block so no need to consider it here
    2621     float logicalLeft;
    2622     float availableLogicalWidth;
    2623     logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
    2624     availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
    2625     float totalLogicalWidth;
    2626     updateLogicalWidthForAlignment(textAlign, 0l, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
    2627     return logicalLeft;
    2628 }
    2629 
    2630 }
     2592}
Note: See TracChangeset for help on using the changeset viewer.