Changeset 96452 in webkit
- Timestamp:
- Sep 30, 2011 8:07:46 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 21 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96449 r96452 1 2011-09-30 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=69202 4 5 [CSS3 Regions] Make positioned objects use the first region as the ICB when it 6 is their containing block. Make sure static distance computations take into 7 account the current region as well. 8 9 Reviewed by Sam Weinig. 10 11 * fast/regions/positioned-objects-block-static-in-regions.html: Added. 12 * fast/regions/positioned-objects-block-static-in-rtl-regions.html: Added. 13 * fast/regions/positioned-objects-in-regions.html: Added. 14 * fast/regions/positioned-objects-in-rtl-regions.html: Added. 15 * fast/regions/positioned-objects-inline-static-in-regions.html: Added. 16 * fast/regions/positioned-objects-inline-static-in-rtl-regions.html: Added. 17 * fast/regions/positioned-objects-perpendicular-flows-in-regions.html: Added. 18 * platform/mac/fast/regions/positioned-objects-block-static-in-regions-expected.png: Added. 19 * platform/mac/fast/regions/positioned-objects-block-static-in-regions-expected.txt: Added. 20 * platform/mac/fast/regions/positioned-objects-block-static-in-rtl-regions-expected.png: Added. 21 * platform/mac/fast/regions/positioned-objects-block-static-in-rtl-regions-expected.txt: Added. 22 * platform/mac/fast/regions/positioned-objects-in-regions-expected.png: Added. 23 * platform/mac/fast/regions/positioned-objects-in-regions-expected.txt: Added. 24 * platform/mac/fast/regions/positioned-objects-in-rtl-regions-expected.png: Added. 25 * platform/mac/fast/regions/positioned-objects-in-rtl-regions-expected.txt: Added. 26 * platform/mac/fast/regions/positioned-objects-inline-static-in-regions-expected.png: Added. 27 * platform/mac/fast/regions/positioned-objects-inline-static-in-regions-expected.txt: Added. 28 * platform/mac/fast/regions/positioned-objects-inline-static-in-rtl-regions-expected.png: Added. 29 * platform/mac/fast/regions/positioned-objects-inline-static-in-rtl-regions-expected.txt: Added. 30 * platform/mac/fast/regions/positioned-objects-perpendicular-flows-in-regions-expected.png: Added. 31 * platform/mac/fast/regions/positioned-objects-perpendicular-flows-in-regions-expected.txt: Added. 32 1 33 2011-09-30 David Barr <davidbarr@chromium.org> 2 34 -
trunk/Source/WebCore/ChangeLog
r96449 r96452 1 2011-09-30 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=69202 4 5 [CSS3 Regions] Make positioned objects use the first region as the ICB when it 6 is their containing block. Make sure static distance computations take into 7 account the current region as well. 8 9 Reviewed by Sam Weinig. 10 11 Added new tests in fast/regions. 12 13 * rendering/RenderBlock.cpp: 14 (WebCore::RenderBlock::adjustPositionedBlock): 15 * rendering/RenderBlock.h: 16 (WebCore::RenderBlock::startOffsetForContent): 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::containingBlockLogicalWidthForPositioned): 19 (WebCore::RenderBox::containingBlockLogicalHeightForPositioned): 20 (WebCore::computeInlineStaticDistance): 21 (WebCore::computeLogicalLeftPositionedOffset): 22 (WebCore::computeLogicalTopPositionedOffset): 23 * rendering/RenderFlowThread.cpp: 24 (WebCore::RenderFlowThread::contentLogicalWidthOfFirstRegion): 25 (WebCore::RenderFlowThread::contentLogicalHeightOfFirstRegion): 26 (WebCore::RenderFlowThread::contentLogicalLeftOfFirstRegion): 27 * rendering/RenderFlowThread.h: 28 1 29 2011-09-30 David Barr <davidbarr@chromium.org> 2 30 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r96423 r96452 1474 1474 RenderLayer* childLayer = child->layer(); 1475 1475 1476 childLayer->setStaticInlinePosition( borderAndPaddingStart());1476 childLayer->setStaticInlinePosition(startOffsetForContent(logicalHeight())); 1477 1477 1478 1478 LayoutUnit logicalTop = logicalHeight(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r96408 r96452 129 129 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine); } 130 130 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine); } 131 LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : width() - logicalRightOffsetForLine(position, firstLine); }131 LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : logicalWidth() - logicalRightOffsetForLine(position, firstLine); } 132 132 LayoutUnit startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine); 133 133 LayoutUnit textIndentOffset() const; … … 264 264 LayoutUnit logicalRightOffsetForContent(LayoutUnit position) const; 265 265 LayoutUnit availableLogicalWidthForContent(LayoutUnit position) const { return max(0, logicalRightOffsetForContent(position) - logicalLeftOffsetForContent(position)); } 266 LayoutUnit startOffsetForContent(LayoutUnit position) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForContent(position) : logicalWidth() - logicalRightOffsetForContent(position); } 266 267 267 268 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r96162 r96452 870 870 child->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(child, blockHeight, false)); 871 871 else 872 child->layer()->setStaticInlinePosition(block-> borderAndPaddingStart());872 child->layer()->setStaticInlinePosition(block->startOffsetForContent(blockHeight)); 873 873 child->layer()->setStaticBlockPosition(blockHeight); 874 874 } … … 2153 2153 bool isInlineType = box->style()->isOriginalDisplayInlineType(); 2154 2154 if (!isInlineType) 2155 box->layer()->setStaticInlinePosition(m_block-> borderAndPaddingStart());2155 box->layer()->setStaticInlinePosition(m_block->startOffsetForContent(m_block->logicalHeight())); 2156 2156 else { 2157 2157 // If our original display was an INLINE type, then we can go ahead … … 2715 2715 2716 2716 if (!style()->isLeftToRightDirection()) 2717 return width() - (logicalLeft + totalLogicalWidth);2717 return logicalWidth() - (logicalLeft + totalLogicalWidth); 2718 2718 return logicalLeft; 2719 2719 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r96431 r96452 2269 2269 return containingBlockLogicalHeightForPositioned(containingBlock, false); 2270 2270 2271 if (containingBlock->isBox()) 2271 if (containingBlock->isBox()) { 2272 if (inRenderFlowThread() && containingBlock->isRenderFlowThread()) 2273 return toRenderFlowThread(containingBlock)->contentLogicalWidthOfFirstRegion(); 2272 2274 return toRenderBox(containingBlock)->clientLogicalWidth(); 2275 } 2273 2276 2274 2277 ASSERT(containingBlock->isRenderInline() && containingBlock->isRelPositioned()); … … 2300 2303 return containingBlockLogicalWidthForPositioned(containingBlock, false); 2301 2304 2302 if (containingBlock->isBox()) 2305 if (containingBlock->isBox()) { 2306 if (inRenderFlowThread() && containingBlock->isRenderFlowThread()) 2307 return toRenderFlowThread(containingBlock)->contentLogicalHeightOfFirstRegion(); 2303 2308 return toRenderBox(containingBlock)->clientLogicalHeight(); 2309 } 2304 2310 2305 2311 ASSERT(containingBlock->isRenderInline() && containingBlock->isRelPositioned()); … … 2335 2341 staticPosition += toRenderBox(curr)->logicalLeft(); 2336 2342 } 2343 2344 // If our container block is an RTL RenderFlowThread, then we also have to subtract out the region offset. 2345 if (child->inRenderFlowThread() && containerBlock->isRenderFlowThread() 2346 && (child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) 2347 && containerBlock->style()->direction() == RTL) 2348 staticPosition -= toRenderFlowThread(containerBlock)->contentLogicalLeftOfFirstRegion(); 2349 2337 2350 logicalLeft.setValue(Fixed, staticPosition); 2338 2351 } else { … … 2344 2357 staticPosition -= toRenderBox(curr)->logicalLeft(); 2345 2358 } 2359 2360 // If our container block is an RTL RenderFlowThread, then we also have to subtract out the region offset. 2361 if (child->inRenderFlowThread() && containerBlock->isRenderFlowThread() 2362 && (child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) 2363 && containerBlock->style()->direction() == RTL) 2364 staticPosition += toRenderFlowThread(containerBlock)->contentLogicalLeftOfFirstRegion(); 2365 2346 2366 logicalRight.setValue(Fixed, staticPosition); 2347 2367 } … … 2490 2510 logicalLeftPos = containerLogicalWidth - logicalWidthValue - logicalLeftPos; 2491 2511 logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderRight() : containerBlock->borderBottom()); 2492 } else 2512 } else { 2493 2513 logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderLeft() : containerBlock->borderTop()); 2514 2515 // If our container block is an RTL RenderFlowThread, then we also have to add in the region offset. 2516 if (child->inRenderFlowThread() && containerBlock->isRenderFlowThread() 2517 && (child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) 2518 && containerBlock->style()->direction() == RTL) 2519 logicalLeftPos += toRenderFlowThread(containerBlock)->contentLogicalLeftOfFirstRegion(); 2520 } 2494 2521 } 2495 2522 … … 2808 2835 logicalTopPos += containerBlock->borderLeft(); 2809 2836 } 2837 2838 // If our container block is an RTL RenderFlowThread, then we also have to add in the region offset. 2839 if (child->inRenderFlowThread() && containerBlock->isRenderFlowThread() 2840 && (child->isHorizontalWritingMode() != containerBlock->isHorizontalWritingMode()) 2841 && containerBlock->style()->direction() == RTL) 2842 logicalTopPos += toRenderFlowThread(containerBlock)->contentLogicalLeftOfFirstRegion(); 2810 2843 } 2811 2844 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r96423 r96452 637 637 } 638 638 639 LayoutUnit RenderFlowThread::contentLogicalWidthOfFirstRegion() const 640 { 641 if (!hasValidRegions()) 642 return 0; 643 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 644 RenderRegion* region = *iter; 645 if (!region->isValid()) 646 continue; 647 return isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight(); 648 } 649 ASSERT_NOT_REACHED(); 650 return 0; 651 } 652 653 LayoutUnit RenderFlowThread::contentLogicalHeightOfFirstRegion() const 654 { 655 if (!hasValidRegions()) 656 return 0; 657 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 658 RenderRegion* region = *iter; 659 if (!region->isValid()) 660 continue; 661 return isHorizontalWritingMode() ? region->contentHeight() : region->contentWidth(); 662 } 663 ASSERT_NOT_REACHED(); 664 return 0; 665 } 666 667 LayoutUnit RenderFlowThread::contentLogicalLeftOfFirstRegion() const 668 { 669 if (!hasValidRegions()) 670 return 0; 671 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 672 RenderRegion* region = *iter; 673 if (!region->isValid()) 674 continue; 675 return isHorizontalWritingMode() ? region->regionRect().x() : region->regionRect().y(); 676 } 677 ASSERT_NOT_REACHED(); 678 return 0; 679 } 680 639 681 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r96408 r96452 110 110 void removeRenderBoxRegionInfo(RenderBox*); 111 111 112 LayoutUnit contentLogicalWidthOfFirstRegion() const; 113 LayoutUnit contentLogicalHeightOfFirstRegion() const; 114 LayoutUnit contentLogicalLeftOfFirstRegion() const; 115 112 116 private: 113 117 virtual const char* renderName() const { return "RenderFlowThread"; }
Note: See TracChangeset
for help on using the changeset viewer.