Changeset 164231 in webkit
- Timestamp:
- Feb 17, 2014 11:10:42 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164227 r164231 1 2014-02-17 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box 4 https://bugs.webkit.org/show_bug.cgi?id=128815 5 6 Reviewed by Andrei Bucur. 7 8 Added tests for the painting of the borders of elements flowed into regions 9 over the region's padding area, for regions with overflow:hidden. 10 Tests were added for all writing modes. 11 12 * fast/regions/box-decorations-over-region-padding-expected.html: Added. 13 * fast/regions/box-decorations-over-region-padding-fragmented-expected.html: Added. 14 * fast/regions/box-decorations-over-region-padding-fragmented.html: Added. 15 * fast/regions/box-decorations-over-region-padding-horiz-bt-expected.html: Added. 16 * fast/regions/box-decorations-over-region-padding-horiz-bt.html: Added. 17 * fast/regions/box-decorations-over-region-padding-vert-lr-expected.html: Added. 18 * fast/regions/box-decorations-over-region-padding-vert-lr.html: Added. 19 * fast/regions/box-decorations-over-region-padding-vert-rl-expected.html: Added. 20 * fast/regions/box-decorations-over-region-padding-vert-rl.html: Added. 21 * fast/regions/box-decorations-over-region-padding.html: Added. 22 1 23 2014-02-17 Brendan Long <b.long@cablelabs.com> 2 24 -
trunk/Source/WebCore/ChangeLog
r164227 r164231 1 2014-02-17 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box 4 https://bugs.webkit.org/show_bug.cgi?id=128815 5 6 Reviewed by Andrei Bucur. 7 8 Elements flowed into a region should not be painted past the region's content box 9 if they continue to flow into another region in that direction. 10 If they do not continue into another region in that direction, they should be 11 painted all the way to the region's border box. 12 Regions with overflow:hidden will apply clip at the border box, not the content box. 13 14 Tests: fast/regions/box-decorations-over-region-padding-fragmented.html 15 fast/regions/box-decorations-over-region-padding-horiz-bt.html 16 fast/regions/box-decorations-over-region-padding-vert-lr.html 17 fast/regions/box-decorations-over-region-padding-vert-rl.html 18 fast/regions/box-decorations-over-region-padding.html 19 20 * rendering/RenderNamedFlowFragment.cpp: 21 (WebCore::RenderNamedFlowFragment::flowThreadPortionRectForClipping): 22 * rendering/RenderNamedFlowFragment.h: 23 * rendering/RenderRegion.cpp: 24 (WebCore::RenderRegion::rectFlowPortionForBox): 25 1 26 2014-02-17 Brendan Long <b.long@cablelabs.com> 2 27 -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
r163333 r164231 189 189 } 190 190 191 LayoutRect RenderNamedFlowFragment::flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const 192 { 193 // Elements flowed into a region should not be painted past the region's content box 194 // if they continue to flow into another region in that direction. 195 // If they do not continue into another region in that direction, they should be 196 // painted all the way to the region's border box. 197 // Regions with overflow:hidden will apply clip at the border box, not the content box. 198 199 LayoutRect clippingRect = flowThreadPortionRect(); 200 if (regionContainer()->style().hasPadding()) { 201 if (isFirstRegionInRange) { 202 if (flowThread()->isHorizontalWritingMode()) { 203 clippingRect.move(0, -regionContainer()->paddingBefore()); 204 clippingRect.expand(0, regionContainer()->paddingBefore()); 205 } else { 206 clippingRect.move(-regionContainer()->paddingBefore(), 0); 207 clippingRect.expand(regionContainer()->paddingBefore(), 0); 208 } 209 } 210 211 if (isLastRegionInRange) { 212 if (flowThread()->isHorizontalWritingMode()) 213 clippingRect.expand(0, regionContainer()->paddingAfter()); 214 else 215 clippingRect.expand(regionContainer()->paddingAfter(), 0); 216 } 217 218 if (flowThread()->isHorizontalWritingMode()) { 219 clippingRect.move(-regionContainer()->paddingStart(), 0); 220 clippingRect.expand(regionContainer()->paddingStart() + regionContainer()->paddingEnd(), 0); 221 } else { 222 clippingRect.move(0, -regionContainer()->paddingStart()); 223 clippingRect.expand(0, regionContainer()->paddingStart() + regionContainer()->paddingEnd()); 224 } 225 } 226 227 return clippingRect; 228 } 229 191 230 void RenderNamedFlowFragment::layoutBlock(bool relayoutChildren, LayoutUnit) 192 231 { -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h
r162523 r164231 60 60 virtual LayoutUnit pageLogicalHeight() const; 61 61 LayoutUnit maxPageLogicalHeight() const; 62 63 LayoutRect flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const; 62 64 63 65 bool isPseudoElementRegion() const { return parent() && parent()->isPseudoElement(); } -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r163873 r164231 522 522 523 523 bool isLastRegionWithRegionFragmentBreak = (isLastRegion() && (style().regionFragment() == BreakRegionFragment)); 524 if (hasOverflowClip() || isLastRegionWithRegionFragmentBreak) 525 mappedRect.intersect(flowThreadPortionRect()); 524 if (hasOverflowClip() || isLastRegionWithRegionFragmentBreak) { 525 LayoutRect portionRect; 526 if (isRenderNamedFlowFragment()) 527 portionRect = toRenderNamedFlowFragment(this)->flowThreadPortionRectForClipping(this == startRegion, this == endRegion); 528 else 529 portionRect = flowThreadPortionRect(); 530 531 mappedRect.intersect(portionRect); 532 } 526 533 527 534 return mappedRect.isEmpty() ? mappedRect : m_flowThread->mapFromFlowThreadToLocal(box, mappedRect);
Note: See TracChangeset
for help on using the changeset viewer.