Changeset 152906 in webkit
- Timestamp:
- Jul 19, 2013 10:46:08 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152904 r152906 1 2013-07-19 Zoltan Horvath <zoltan@webkit.org> 2 3 [CSS Shapes] Clear overflowing line's segments in pushShapeContentOverflowBelowTheContentBox 4 https://bugs.webkit.org/show_bug.cgi?id=118002 5 6 Reviewed by David Hyatt. 7 8 When the last line in the shape overlaps with the shape bottom boundaries we need to clear the computed segments. (We need to compute 9 the segments anyway, since shape-outside's code uses the same code path to determine its segments and the line containing is not a 10 requirement in that case.) Rather then doing the job in RenderBlock::LineBreaker::nextLineBreak I moved the functionality to its correct 11 place to pushShapeContentOverflowBelowTheContentBox. Now all the overflow related functionality is located in one function. I fixed the 12 corresponding layout test. 13 14 * fast/shapes/shape-inside/shape-inside-overflow-expected.html: 15 * fast/shapes/shape-inside/shape-inside-overflow.html: 16 1 17 2013-07-19 Zoltan Horvath <zoltan@webkit.org> 2 18 -
trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-overflow-expected.html
r152800 r152906 10 10 border: 2px solid blue; 11 11 } 12 # border{13 position: absolute;14 left: 48px;12 #shape-inside { 13 margin-top: -2px; 14 margin-left: 48px; 15 15 width: 100px; 16 height: 40px;16 height: 50px; 17 17 border: 2px solid green; 18 18 } 19 .spacer { 20 width: 50px; 21 height: 40px; 22 } 19 #overflow { margin-top: -2px; } 23 20 </style> 24 21 </head> 25 22 <body> 26 23 <div id="container"> 27 <div id="border"></div> 28 <div id="shape-inside"> 29 <div class="spacer" style="float:left"></div> 30 <div class="spacer" style="float:right"></div> 31 This text should wrap inside the green rectangle, and overflow should wrap 24 <div id="shape-inside">This text should wrap</div> 25 <div id="overflow"> 26 inside the green rectangle, and overflow should wrap 32 27 inside the blue rectangle. 33 28 </div> -
trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-overflow.html
r152800 r152906 21 21 left: 48px; 22 22 width: 100px; 23 height: 40px; 23 height: 50px; 24 margin-top: -2px; 24 25 border: 2px solid green; 25 26 } -
trunk/Source/WebCore/ChangeLog
r152905 r152906 1 2013-07-19 Zoltan Horvath <zoltan@webkit.org> 2 3 [CSS Shapes] Clear overflowing line's segments in pushShapeContentOverflowBelowTheContentBox 4 https://bugs.webkit.org/show_bug.cgi?id=118002 5 6 Reviewed by David Hyatt. 7 8 When the last line in the shape overlaps with the shape bottom boundaries we need to clear the computed segments. (We need to compute 9 the segments anyway, since shape-outside's code uses the same code path to determine its segments and the line containing is not a 10 requirement in that case.) Rather then doing the job in RenderBlock::LineBreaker::nextLineBreak I moved the functionality to its correct 11 place to pushShapeContentOverflowBelowTheContentBox. Now all the overflow related functionality is located in one function. I fixed the 12 corresponding layout test. 13 14 Tests: I modified shape-inside-overflow.html. 15 16 * rendering/RenderBlockLineLayout.cpp: 17 (WebCore::pushShapeContentOverflowBelowTheContentBox): Remove segments if line overlaps with the shape's boundaries. 18 (WebCore::RenderBlock::LineBreaker::nextLineBreak): Move segments clear logic to pushShapeContentOverflowBelowContentBox. 19 1 20 2013-07-19 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r152905 r152906 1666 1666 1667 1667 LayoutUnit logicalLineBottom = lineTop + lineHeight; 1668 LayoutUnit shapeLogicalBottom = shapeInsideInfo->shapeLogicalBottom(); 1668 1669 LayoutUnit shapeContainingBlockHeight = shapeInsideInfo->shapeContainingBlockHeight(); 1669 1670 1670 1671 bool isOverflowPositionedAlready = (shapeContainingBlockHeight - shapeInsideInfo->owner()->borderAndPaddingAfter() + lineHeight) <= lineTop; 1671 1672 1672 if (logicalLineBottom <= shapeInsideInfo->shapeLogicalBottom() || !shapeContainingBlockHeight || isOverflowPositionedAlready) 1673 // If the last line overlaps with the shape, we don't need the segments anymore 1674 if (lineTop < shapeLogicalBottom && shapeLogicalBottom < logicalLineBottom) 1675 shapeInsideInfo->clearSegments(); 1676 1677 if (logicalLineBottom <= shapeLogicalBottom || !shapeContainingBlockHeight || isOverflowPositionedAlready) 1673 1678 return; 1674 1679 … … 2811 2816 if (!shapeInsideInfo || !shapeInsideInfo->lineOverlapsShapeBounds()) 2812 2817 return nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements); 2813 2814 // In layoutRunsAndFloatsInRange we have to use lineOverlapsShapeBounds() to determine the line segments since shape-outside's codepaths uses the same code to determine its segments. The line containing is not a requirement for shape-outside,2815 // so in this case we can end up with some extra segments for the overflowing content, but we don't want to apply the segments for the overflowing content, so we need to reset it.2816 if (!m_block->flowThreadContainingBlock() && !shapeInsideInfo->lineWithinShapeBounds()) {2817 shapeInsideInfo->clearSegments();2818 return nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);2819 }2820 2818 2821 2819 InlineIterator end = resolver.position();
Note: See TracChangeset
for help on using the changeset viewer.