Changeset 93621 in webkit
- Timestamp:
- Aug 23, 2011 12:07:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93616 r93621 1 2011-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 1 20 2011-07-25 Robert Hogan <robert@webkit.org> 2 21 -
trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt
r93616 r93621 15 15 RenderText {#text} at (0,0) size 277x19 16 16 text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog" 17 layer at (1 62,37) size 277x2018 RenderBlock (positioned) {SPAN} at (1 62,37) size 277x2017 layer at (1,37) size 277x20 18 RenderBlock (positioned) {SPAN} at (1,37) size 277x20 19 19 RenderText {#text} at (0,0) size 277x19 20 20 text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog" -
trunk/Source/WebCore/ChangeLog
r93616 r93621 1 2011-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 1 19 2011-07-25 Robert Hogan <robert@webkit.org> 2 20 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r93616 r93621 1476 1476 RenderLayer* childLayer = child->layer(); 1477 1477 1478 childLayer->setStaticInlinePosition( startAlignedOffsetForBlock(logicalHeight(), false));1478 childLayer->setStaticInlinePosition(borderAndPaddingStart()); 1479 1479 1480 1480 LayoutUnit logicalTop = logicalHeight(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r93616 r93621 130 130 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); } 131 131 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);134 132 135 133 virtual VisiblePosition positionForPoint(const LayoutPoint&); … … 225 223 LayoutUnit collapsedMarginAfterForChild(RenderBox* child) const; 226 224 227 void updateLogicalWidthForAlignment(const ETextAlign&, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);228 229 225 virtual void updateFirstLetter(); 230 226 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r93616 r93621 550 550 } 551 551 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 the556 // objects horizontally. The total width of the line can be increased if we end up557 // 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 through573 case TAAUTO:574 // for right to left fall through to right aligned575 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 else592 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 else598 updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);599 break;600 }601 }602 603 552 void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, const LineInfo& lineInfo, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, 604 553 GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache) … … 657 606 } 658 607 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 } 660 655 661 656 computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth); … … 718 713 // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned 719 714 // inline so that we can obtain the value later. 720 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->start AlignedOffsetForLine(blockHeight, false));715 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false)); 721 716 toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight); 722 717 } 723 718 724 719 if (child->style()->isOriginalDisplayInlineType()) 725 child->layer()->setStaticInlinePosition(block->start AlignedOffsetForLine(blockHeight, false));720 child->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false)); 726 721 else 727 child->layer()->setStaticInlinePosition(block-> startAlignedOffsetForBlock(blockHeight, false));722 child->layer()->setStaticInlinePosition(block->borderAndPaddingStart()); 728 723 child->layer()->setStaticBlockPosition(blockHeight); 729 724 } … … 2050 2045 bool isInlineType = box->style()->isOriginalDisplayInlineType(); 2051 2046 if (!isInlineType) 2052 box->layer()->setStaticInlinePosition(m_block-> startAlignedOffsetForBlock(m_block->logicalHeight(), false));2047 box->layer()->setStaticInlinePosition(m_block->borderAndPaddingStart()); 2053 2048 else { 2054 2049 // If our original display was an INLINE type, then we can go ahead … … 2595 2590 } 2596 2591 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.