Changeset 96675 in webkit
- Timestamp:
- Oct 4, 2011 9:45:48 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96672 r96675 1 2011-10-04 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=69398 4 5 [CSS3 Regions] Support the region-overflow property properly. 6 7 Reviewed by Dan Bernstein. 8 9 * fast/regions/region-overflow-auto-overflow-hidden.html: Added. 10 * fast/regions/region-overflow-auto-overflow-visible.html: Added. 11 * fast/regions/region-overflow-break.html: Added. 12 * fast/regions/script-tests/webkit-region-overflow-parsing.js: 13 * fast/regions/webkit-region-overflow-parsing-expected.txt: 14 * platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: 15 * platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt: 16 * platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: 17 * platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt: 18 * platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: 19 * platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt: 20 * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.png: 21 * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt: 22 * platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.png: Added. 23 * platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.txt: Added. 24 * platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.png: Added. 25 * platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.txt: Added. 26 * platform/mac/fast/regions/region-overflow-break-expected.png: Added. 27 * platform/mac/fast/regions/region-overflow-break-expected.txt: Added. 28 * platform/mac/fast/regions/text-region-split-small-pagination-expected.txt: 29 * platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png: 30 * platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt: 31 * platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.png: 32 * platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.txt: 33 1 34 2011-10-04 Sadrul Habib Chowdhury <sadrul@chromium.org> 2 35 -
trunk/LayoutTests/fast/regions/script-tests/webkit-region-overflow-parsing.js
r91286 r96675 22 22 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': initial")', "initial"); 23 23 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': inherit")', "inherit"); 24 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': -webkit-break")', "-webkit-break");24 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': break")', "break"); 25 25 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': 0")', ""); 26 26 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': -1")', ""); … … 31 31 shouldBeEqualToString('testComputedStyle("initial")', "auto"); 32 32 shouldBeEqualToString('testComputedStyle("inherit")', "auto"); 33 shouldBeEqualToString('testComputedStyle(" -webkit-break")', "-webkit-break");33 shouldBeEqualToString('testComputedStyle("break")', "break"); 34 34 shouldBeEqualToString('testComputedStyle("0")', "auto"); 35 35 shouldBeEqualToString('testComputedStyle("-1")', "auto"); -
trunk/LayoutTests/fast/regions/webkit-region-overflow-parsing-expected.txt
r91286 r96675 7 7 PASS testCSSText("-webkit-region-overflow: initial") is "initial" 8 8 PASS testCSSText("-webkit-region-overflow: inherit") is "inherit" 9 PASS testCSSText("-webkit-region-overflow: -webkit-break") is "-webkit-break"9 PASS testCSSText("-webkit-region-overflow: break") is "break" 10 10 PASS testCSSText("-webkit-region-overflow: 0") is "" 11 11 PASS testCSSText("-webkit-region-overflow: -1") is "" … … 15 15 PASS testComputedStyle("initial") is "auto" 16 16 PASS testComputedStyle("inherit") is "auto" 17 PASS testComputedStyle(" -webkit-break") is "-webkit-break"17 PASS testComputedStyle("break") is "break" 18 18 PASS testComputedStyle("0") is "auto" 19 19 PASS testComputedStyle("-1") is "auto" -
trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt
r96423 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x59 515 RenderBlock {DIV} at (34,5) size 232x58 5[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 210x56 3[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x599 15 RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)] 17 17 RenderBlock {P} at (1,17) size 208x157 18 18 RenderText {#text} at (-10,0) size 218x157 … … 26 26 text run at (100,139) width 4 RTL: "." 27 27 text run at (104,139) width 104: "out of the region" 28 RenderBlock {P} at (1,190) size 208x2 4829 RenderText {#text} at (0,0) size 226x2 4828 RenderBlock {P} at (1,190) size 208x236 29 RenderText {#text} at (0,0) size 226x236 30 30 text run at (0,0) width 208: "This line of text should not get" 31 31 text run at (0,18) width 208: "out of the region. This line of" … … 38 38 text run at (-18,146) width 64: "of text" 39 39 text run at (4,164) width 42: "should" 40 text run at (-18,1 94) width 64: "not get"41 text run at (-18,2 12) width 64: "out of the"42 text run at (2,2 30) width 4 RTL: "."43 text run at (6,2 30) width 40: "region"44 RenderBlock {P} at (1,4 38) size 208x10840 text run at (-18,182) width 64: "not get" 41 text run at (-18,200) width 64: "out of the" 42 text run at (2,218) width 4 RTL: "." 43 text run at (6,218) width 40: "region" 44 RenderBlock {P} at (1,442) size 208x108 45 45 RenderText {#text} at (-18,0) size 64x108 46 46 text run at (-18,0) width 64: "This line" -
trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt
r96423 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x59 515 RenderBlock {DIV} at (34,5) size 232x58 5[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 210x56 3[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x599 15 RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)] 17 17 RenderBlock {P} at (1,17) size 208x157 18 18 RenderText {#text} at (90,0) size 218x157 … … 25 25 text run at (0,121) width 208: "This line of text should not get" 26 26 text run at (0,139) width 108: "out of the region." 27 RenderBlock {P} at (1,190) size 208x2 4828 RenderText {#text} at (0,0) size 226x2 4827 RenderBlock {P} at (1,190) size 208x236 28 RenderText {#text} at (0,0) size 226x236 29 29 text run at (0,0) width 208: "This line of text should not get" 30 30 text run at (0,18) width 208: "out of the region. This line of" … … 37 37 text run at (162,146) width 64: "of text" 38 38 text run at (162,164) width 42: "should" 39 text run at (162,1 94) width 64: "not get"40 text run at (162,2 12) width 64: "out of the"41 text run at (162,2 30) width 44: "region."42 RenderBlock {P} at (1,4 38) size 208x10839 text run at (162,182) width 64: "not get" 40 text run at (162,200) width 64: "out of the" 41 text run at (162,218) width 44: "region." 42 RenderBlock {P} at (1,442) size 208x108 43 43 RenderText {#text} at (162,0) size 64x108 44 44 text run at (162,0) width 64: "This line" -
trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt
r96423 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x59 515 RenderBlock {DIV} at (34,5) size 232x58 5[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 210x56 3[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x599 15 RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)] 17 17 RenderBlock {P} at (1,17) size 208x157 18 18 RenderText {#text} at (90,0) size 218x157 … … 26 26 text run at (100,139) width 4 RTL: "." 27 27 text run at (104,139) width 104: "out of the region" 28 RenderBlock {P} at (1,190) size 208x2 4829 RenderText {#text} at (0,0) size 226x2 4828 RenderBlock {P} at (1,190) size 208x236 29 RenderText {#text} at (0,0) size 226x236 30 30 text run at (0,0) width 208: "This line of text should not get" 31 31 text run at (0,18) width 208: "out of the region. This line of" … … 38 38 text run at (162,146) width 64: "of text" 39 39 text run at (184,164) width 42: "should" 40 text run at (162,1 94) width 64: "not get"41 text run at (162,2 12) width 64: "out of the"42 text run at (182,2 30) width 4 RTL: "."43 text run at (186,2 30) width 40: "region"44 RenderBlock {P} at (1,4 38) size 208x10840 text run at (162,182) width 64: "not get" 41 text run at (162,200) width 64: "out of the" 42 text run at (182,218) width 4 RTL: "." 43 text run at (186,218) width 40: "region" 44 RenderBlock {P} at (1,442) size 208x108 45 45 RenderText {#text} at (162,0) size 64x108 46 46 text run at (162,0) width 64: "This line" -
trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt
r96408 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x59 515 RenderBlock {DIV} at (34,5) size 232x58 5[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 210x56 3[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x599 15 RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)] 17 17 RenderBlock {P} at (1,17) size 208x157 18 18 RenderText {#text} at (-10,0) size 218x157 … … 25 25 text run at (0,121) width 208: "This line of text should not get" 26 26 text run at (0,139) width 108: "out of the region." 27 RenderBlock {P} at (1,190) size 208x2 4828 RenderText {#text} at (0,0) size 226x2 4827 RenderBlock {P} at (1,190) size 208x236 28 RenderText {#text} at (0,0) size 226x236 29 29 text run at (0,0) width 208: "This line of text should not get" 30 30 text run at (0,18) width 208: "out of the region. This line of" … … 37 37 text run at (-18,146) width 64: "of text" 38 38 text run at (-18,164) width 42: "should" 39 text run at (-18,1 94) width 64: "not get"40 text run at (-18,2 12) width 64: "out of the"41 text run at (-18,2 30) width 44: "region."42 RenderBlock {P} at (1,4 38) size 208x10839 text run at (-18,182) width 64: "not get" 40 text run at (-18,200) width 64: "out of the" 41 text run at (-18,218) width 44: "region." 42 RenderBlock {P} at (1,442) size 208x108 43 43 RenderText {#text} at (-18,0) size 64x108 44 44 text run at (-18,0) width 64: "This line" -
trunk/LayoutTests/platform/mac/fast/regions/text-region-split-small-pagination-expected.txt
r95670 r96675 12 12 layer at (0,0) size 200x180 13 13 RenderFlowThread at (0,0) size 200x180 14 RenderBlock {DIV} at (0,30) size 200x1 5014 RenderBlock {DIV} at (0,30) size 200x118 15 15 RenderBlock {P} at (0,0) size 200x118 16 16 RenderInline {B} at (0,0) size 111x18 -
trunk/LayoutTests/platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt
r95750 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x4 6915 RenderBlock {DIV} at (5,5) size 290x4 59[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 268x4 37[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x455 15 RenderBlock {DIV} at (5,5) size 290x445 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 268x423 [border: (1px solid #008000)] 17 17 RenderBlock {P} at (1,17) size 266x36 18 18 RenderText {#text} at (0,0) size 166x36 … … 39 39 text run at (0,92) width 86: "get out of the" 40 40 text run at (0,110) width 44: "region." 41 RenderBlock {P} at (1,334) size 266x 8642 RenderText {#text} at (0,0) size 86x 8641 RenderBlock {P} at (1,334) size 266x72 42 RenderText {#text} at (0,0) size 86x72 43 43 text run at (0,0) width 86: "This line of" 44 44 text run at (0,18) width 86: "text should" 45 text run at (0, 50) width 86: "not get out of"46 text run at (0, 68) width 67: "the region."45 text run at (0,36) width 86: "not get out of" 46 text run at (0,54) width 67: "the region." 47 47 Regions for flow 'flow1' 48 48 RenderRegion {DIV} #region1 with index 0 -
trunk/LayoutTests/platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.txt
r95756 r96675 12 12 layer at (0,0) size 300x400 13 13 RenderFlowThread at (0,0) size 300x400 14 RenderBlock {DIV} at (0,0) size 300x4 7115 RenderBlock {DIV} at (5,5) size 290x4 61[border: (1px solid #0000FF)]16 RenderBlock {DIV} at (11,11) size 268x4 39[border: (1px solid #008000)]14 RenderBlock {DIV} at (0,0) size 300x459 15 RenderBlock {DIV} at (5,5) size 290x449 [border: (1px solid #0000FF)] 16 RenderBlock {DIV} at (11,11) size 268x427 [border: (1px solid #008000)] 17 17 RenderInline {SPAN} at (0,0) size 266x101 18 18 RenderText {#text} at (1,1) size 166x36 … … 40 40 RenderBR {BR} at (45,300) size 0x18 41 41 RenderBR {BR} at (1,318) size 0x18 42 RenderText {#text} at (1,336) size 86x 8442 RenderText {#text} at (1,336) size 86x72 43 43 text run at (1,336) width 86: "This line of" 44 44 text run at (1,354) width 86: "text should" 45 text run at (1,3 84) width 86: "not get out of"46 text run at (1, 402) width 67: "the region."47 RenderBR {BR} at (68, 402) size 0x1848 RenderBR {BR} at (1,4 20) size 0x1845 text run at (1,372) width 86: "not get out of" 46 text run at (1,390) width 67: "the region." 47 RenderBR {BR} at (68,390) size 0x18 48 RenderBR {BR} at (1,408) size 0x18 49 49 Regions for flow 'flow1' 50 50 RenderRegion {DIV} #region1 with index 0 -
trunk/Source/WebCore/ChangeLog
r96674 r96675 1 2011-10-04 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=69398 4 5 [CSS3 Regions] Support the region-overflow property properly. 6 7 (1) Change -webkit-break to break, since the -webkit-region-overflow property already has the 8 -webkit- extension. 9 10 (2) Fix clipping so that it works when overflow is set or when region break is set. 11 12 (3) Refactor all the pagination spots to check if a next page is available using the new hasNextPage 13 function. This prevents us from paginating if we hit the last region and further breaks are no longer 14 allowed. 15 16 Reviewed by Dan Bernstein. 17 18 Added new tests in fast/regions. 19 20 * css/CSSParser.cpp: 21 (WebCore::CSSParser::parseValue): 22 * css/CSSPrimitiveValueMappings.h: 23 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 24 (WebCore::CSSPrimitiveValue::operator RegionOverflow): 25 * css/CSSValueKeywords.in: 26 * rendering/RenderBlock.cpp: 27 (WebCore::RenderBlock::collapseMargins): 28 (WebCore::RenderBlock::estimateLogicalTopPosition): 29 (WebCore::RenderBlock::hasNextPage): 30 (WebCore::RenderBlock::nextPageLogicalTop): 31 (WebCore::RenderBlock::applyBeforeBreak): 32 (WebCore::RenderBlock::applyAfterBreak): 33 (WebCore::RenderBlock::pageLogicalHeightForOffset): 34 (WebCore::RenderBlock::pageRemainingLogicalHeightForOffset): 35 (WebCore::RenderBlock::adjustForUnsplittableChild): 36 (WebCore::RenderBlock::pushToNextPageWithMinimumLogicalHeight): 37 (WebCore::RenderBlock::adjustLinePositionForPagination): 38 * rendering/RenderBlock.h: 39 * rendering/RenderFlowThread.cpp: 40 (WebCore::RenderFlowThread::layout): 41 (WebCore::RenderFlowThread::repaintRectangleInRegions): 42 (WebCore::RenderFlowThread::regionRemainingLogicalHeightForLine): 43 * rendering/RenderFlowThread.h: 44 * rendering/RenderRegion.cpp: 45 (WebCore::RenderRegion::regionOverflowRect): 46 1 47 2011-10-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 48 -
trunk/Source/WebCore/css/CSSParser.cpp
r96449 r96675 1643 1643 break; 1644 1644 case CSSPropertyWebkitRegionOverflow: 1645 if (id == CSSValueAuto || id == CSSValue WebkitBreak)1645 if (id == CSSValueAuto || id == CSSValueBreak) 1646 1646 validPrimitive = true; 1647 1647 break; -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r95911 r96675 1598 1598 break; 1599 1599 case BreakRegionOverflow: 1600 m_value.ident = CSSValue WebkitBreak;1600 m_value.ident = CSSValueBreak; 1601 1601 break; 1602 1602 } … … 1608 1608 case CSSValueAuto: 1609 1609 return AutoRegionOverflow; 1610 case CSSValue WebkitBreak:1610 case CSSValueBreak: 1611 1611 return BreakRegionOverflow; 1612 1612 default: -
trunk/Source/WebCore/css/CSSValueKeywords.in
r95859 r96675 843 843 // -webkit-region-overflow 844 844 // auto 845 -webkit-break845 break -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r96620 r96675 1704 1704 // collapsed into the page edge. 1705 1705 LayoutState* layoutState = view()->layoutState(); 1706 if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTop > beforeCollapseLogicalTop) { 1706 if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTop > beforeCollapseLogicalTop 1707 && hasNextPage(beforeCollapseLogicalTop)) { 1707 1708 LayoutUnit oldLogicalTop = logicalTop; 1708 logicalTop = min(logicalTop, nextPageLogicalTop ExcludingBoundaryPoint(beforeCollapseLogicalTop));1709 logicalTop = min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop)); 1709 1710 setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop)); 1710 1711 } … … 1774 1775 // page. 1775 1776 LayoutState* layoutState = view()->layoutState(); 1776 if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTopEstimate > logicalHeight()) 1777 logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTopExcludingBoundaryPoint(logicalHeight())); 1777 if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTopEstimate > logicalHeight() 1778 && hasNextPage(logicalHeight())) 1779 logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTop(logicalHeight())); 1778 1780 1779 1781 logicalTopEstimate += getClearDelta(child, logicalTopEstimate); … … 6130 6132 } 6131 6133 6132 LayoutUnit RenderBlock::nextPageLogicalTopExcludingBoundaryPoint(LayoutUnit logicalOffset) const 6134 bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const 6135 { 6136 ASSERT(view()->layoutState() && view()->layoutState()->isPaginated()); 6137 6138 if (!inRenderFlowThread()) 6139 return true; // Printing and multi-column both make new pages to accommodate content. 6140 6141 // See if we're in the last region. 6142 LayoutUnit pageOffset = offsetFromLogicalTopOfFirstPage() + logicalOffset; 6143 RenderRegion* region = enclosingRenderFlowThread()->renderRegionForLine(pageOffset, false); 6144 if (!region) 6145 return false; 6146 if (region->isLastRegion()) 6147 return region->style()->regionOverflow() == BreakRegionOverflow 6148 || (pageBoundaryRule == IncludePageBoundary && pageOffset == region->offsetFromLogicalTopOfFirstPage()); 6149 return true; 6150 } 6151 6152 LayoutUnit RenderBlock::nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const 6133 6153 { 6134 6154 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); … … 6138 6158 // The logicalOffset is in our coordinate space. We can add in our pushed offset. 6139 6159 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset); 6140 return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight); 6141 } 6142 6143 LayoutUnit RenderBlock::nextPageLogicalTopIncludingBoundaryPoint(LayoutUnit logicalOffset) const 6144 { 6145 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 6146 if (!pageLogicalHeight) 6147 return logicalOffset; 6148 6149 // The logicalOffset is in our coordinate space. We can add in our pushed offset. 6150 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset); 6160 if (pageBoundaryRule == ExcludePageBoundary) 6161 return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight); 6151 6162 return logicalOffset + remainingLogicalHeight; 6152 6163 } … … 6174 6185 bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS) 6175 6186 || (checkRegionBreaks && child->style()->regionBreakBefore() == PBALWAYS); 6176 if (checkBeforeAlways && inNormalFlow(child) ) {6187 if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) { 6177 6188 if (checkColumnBreaks) 6178 6189 view()->layoutState()->addForcedColumnBreak(logicalOffset); 6179 return nextPageLogicalTop IncludingBoundaryPoint(logicalOffset);6190 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); 6180 6191 } 6181 6192 return logicalOffset; … … 6190 6201 bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS) 6191 6202 || (checkRegionBreaks && child->style()->regionBreakAfter() == PBALWAYS); 6192 if (checkAfterAlways && inNormalFlow(child) ) {6203 if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) { 6193 6204 marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content. 6194 6205 if (checkColumnBreaks) 6195 6206 view()->layoutState()->addForcedColumnBreak(logicalOffset); 6196 return nextPageLogicalTop IncludingBoundaryPoint(logicalOffset);6207 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); 6197 6208 } 6198 6209 return logicalOffset; … … 6204 6215 if (!inRenderFlowThread()) 6205 6216 return renderView->layoutState()->m_pageLogicalHeight; 6206 return enclosingRenderFlowThread()->regionLogicalHeightForLine(offset FromLogicalTopOfFirstPage() + offset);6207 } 6208 6209 LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, bool includeBoundaryPoint) const6217 return enclosingRenderFlowThread()->regionLogicalHeightForLine(offset + offsetFromLogicalTopOfFirstPage()); 6218 } 6219 6220 LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule pageBoundaryRule) const 6210 6221 { 6211 6222 RenderView* renderView = view(); … … 6215 6226 LayoutUnit pageLogicalHeight = renderView->layoutState()->m_pageLogicalHeight; 6216 6227 LayoutUnit remainingHeight = pageLogicalHeight - layoutMod(offset, pageLogicalHeight); 6217 if ( includeBoundaryPoint) {6228 if (pageBoundaryRule == IncludePageBoundary) { 6218 6229 // If includeBoundaryPoint is true the line exactly on the top edge of a 6219 6230 // column will act as being part of the previous column. … … 6223 6234 } 6224 6235 6225 return enclosingRenderFlowThread()->regionRemainingLogicalHeightForLine(offset, includeBoundaryPoint);6236 return enclosingRenderFlowThread()->regionRemainingLogicalHeightForLine(offset, pageBoundaryRule); 6226 6237 } 6227 6238 … … 6238 6249 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 6239 6250 bool hasUniformPageLogicalHeight = !inRenderFlowThread() || enclosingRenderFlowThread()->regionsHaveUniformLogicalHeight(); 6240 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && childLogicalHeight > pageLogicalHeight)) 6251 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && childLogicalHeight > pageLogicalHeight) 6252 || !hasNextPage(logicalOffset)) 6241 6253 return logicalOffset; 6242 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset );6254 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary); 6243 6255 if (remainingLogicalHeight < childLogicalHeight) { 6244 6256 if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, childLogicalHeight)) … … 6251 6263 bool RenderBlock::pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const 6252 6264 { 6253 bool check edRegion = false;6265 bool checkRegion = false; 6254 6266 for (LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment); pageLogicalHeight; 6255 6256 6267 pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) { 6268 if (minimumLogicalHeight <= pageLogicalHeight) 6257 6269 return true; 6258 adjustment += pageLogicalHeight; 6259 checkedRegion = true; 6260 } 6261 return !checkedRegion; 6270 if (!hasNextPage(logicalOffset + adjustment)) 6271 return false; 6272 adjustment += pageLogicalHeight; 6273 checkRegion = true; 6274 } 6275 return !checkRegion; 6262 6276 } 6263 6277 … … 6294 6308 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 6295 6309 bool hasUniformPageLogicalHeight = !inRenderFlowThread() || enclosingRenderFlowThread()->regionsHaveUniformLogicalHeight(); 6296 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && lineHeight > pageLogicalHeight)) 6310 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && lineHeight > pageLogicalHeight) 6311 || !hasNextPage(logicalOffset)) 6297 6312 return; 6298 const bool includeBoundaryPoint = false; 6299 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, includeBoundaryPoint); 6313 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary); 6300 6314 if (remainingLogicalHeight < lineHeight) { 6301 6315 // If we have a non-uniform page height, then we have to shift further possibly. -
trunk/Source/WebCore/rendering/RenderBlock.h
r96620 r96675 866 866 static void repaintDirtyFloats(Vector<FloatWithRect>& floats); 867 867 868 protected: 868 869 // Pagination routines. 869 870 870 871 // Returns the logicalOffset at the top of the next page. If the offset passed in is already at the top of the current page, 871 // then nextPageLogicalTop ExcludingBoundaryPoint will still move to the top of the next page. nextPageLogicalTopIncludingBoundaryPoint872 // will not.872 // then nextPageLogicalTop with ExcludePageBoundary will still move to the top of the next page. nextPageLogicalTop with 873 // IncludePageBoundary set will not. 873 874 // 874 // For a page height of 800px, the first function will return 800 if the value passed in is 0. The second function will simply return 0. 875 LayoutUnit nextPageLogicalTopExcludingBoundaryPoint(LayoutUnit logicalOffset) const; 876 LayoutUnit nextPageLogicalTopIncludingBoundaryPoint(LayoutUnit logicalOffset) const; 875 // For a page height of 800px, the first rule will return 800 if the value passed in is 0. The second rule will simply return 0. 876 enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary }; 877 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const; 878 bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const; 877 879 878 880 int applyBeforeBreak(RenderBox* child, int logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column. … … 881 883 LayoutUnit offsetFromLogicalTopOfFirstPage() const; 882 884 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; 883 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, bool includeBoundaryPoint = true) const;885 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const; 884 886 bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const; 885 887 … … 895 897 RenderRegion* regionAtBlockOffset(LayoutUnit) const; 896 898 bool logicalWidthChangedInRegions() const; 897 899 900 private: 898 901 struct FloatingObjectHashFunctions { 899 902 static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::Hash::hash(key->m_renderer); } -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r96643 r96675 353 353 LayoutRect regionRect; 354 354 if (isHorizontalWritingMode()) { 355 regionRect = IntRect(style()->direction() == LTR ? 0 : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());355 regionRect = LayoutRect(style()->direction() == LTR ? 0 : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight()); 356 356 logicalHeight += regionRect.height(); 357 357 } else { 358 regionRect = IntRect(logicalHeight, style()->direction() == LTR ? 0 : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());358 regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? 0 : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight()); 359 359 logicalHeight += regionRect.width(); 360 360 } … … 511 511 flipForWritingMode(flippedRegionOverflowRect); 512 512 513 IntRect clippedRect(flippedRegionOverflowRect);513 LayoutRect clippedRect(flippedRegionOverflowRect); 514 514 clippedRect.intersect(repaintRect); 515 515 if (clippedRect.isEmpty()) … … 575 575 } 576 576 577 LayoutUnit RenderFlowThread::regionRemainingLogicalHeightForLine(LayoutUnit position, bool includeBoundaryPoint) const577 LayoutUnit RenderFlowThread::regionRemainingLogicalHeightForLine(LayoutUnit position, PageBoundaryRule pageBoundaryRule) const 578 578 { 579 579 RenderRegion* region = renderRegionForLine(position); … … 583 583 LayoutUnit regionLogicalBottom = isHorizontalWritingMode() ? region->regionRect().maxY() : region->regionRect().maxX(); 584 584 LayoutUnit remainingHeight = regionLogicalBottom - position; 585 if ( includeBoundaryPoint) {586 // If includeBoundaryPoint is truethe line exactly on the top edge of a585 if (pageBoundaryRule == IncludePageBoundary) { 586 // If IncludePageBoundary is set, the line exactly on the top edge of a 587 587 // region will act as being part of the previous region. 588 588 LayoutUnit regionHeight = isHorizontalWritingMode() ? region->regionRect().height() : region->regionRect().width(); -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r96643 r96675 100 100 LayoutUnit regionLogicalWidthForLine(LayoutUnit position) const; 101 101 LayoutUnit regionLogicalHeightForLine(LayoutUnit position) const; 102 LayoutUnit regionRemainingLogicalHeightForLine(LayoutUnit position, bool includeBoundaryPoint = true) const;102 LayoutUnit regionRemainingLogicalHeightForLine(LayoutUnit position, PageBoundaryRule = IncludePageBoundary) const; 103 103 RenderRegion* renderRegionForLine(LayoutUnit position, bool extendLastRegion = false) const; 104 104 -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r96643 r96675 56 56 LayoutRect RenderRegion::regionOverflowRect() const 57 57 { 58 if (hasOverflowClip() || !isValid() || !m_flowThread) 58 // FIXME: Would like to just use hasOverflowClip() but we aren't a block yet. When RenderRegion is eliminated and 59 // folded into RenderBlock, switch to hasOverflowClip(). 60 bool clipX = style()->overflowX() != OVISIBLE; 61 bool clipY = style()->overflowY() != OVISIBLE; 62 if ((clipX && clipY) || !isValid() || !m_flowThread) 59 63 return regionRect(); 60 64 … … 65 69 if (m_flowThread->isHorizontalWritingMode()) { 66 70 LayoutUnit minY = isFirstRegion() ? flowThreadOverflow.y() : regionRect().y(); 67 LayoutUnit maxY = isLastRegion() ? flowThreadOverflow.maxY() : regionRect().maxY(); 68 clipRect = LayoutRect(flowThreadOverflow.x(), minY, flowThreadOverflow.width(), maxY - minY); 71 LayoutUnit maxY = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxY() : regionRect().maxY(); 72 clipRect = LayoutRect(clipX ? regionRect().x() : flowThreadOverflow.x(), minY, 73 clipX ? regionRect().width() : flowThreadOverflow.width(), maxY - minY); 69 74 } else { 70 75 LayoutUnit minX = isFirstRegion() ? flowThreadOverflow.x() : regionRect().x(); 71 LayoutUnit maxX = isLastRegion() ? flowThreadOverflow.maxX() : regionRect().maxX(); 72 clipRect = LayoutRect(minX, flowThreadOverflow.y(), maxX - minX, flowThreadOverflow.height()); 76 LayoutUnit maxX = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxX() : regionRect().maxX(); 77 clipRect = LayoutRect(minX, clipY ? regionRect().y() : flowThreadOverflow.y(), 78 maxX - minX, clipY ? regionRect().height() : flowThreadOverflow.height()); 73 79 } 74 80
Note: See TracChangeset
for help on using the changeset viewer.