Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[CSSRegions] Regions should not slice line box rendering
https://bugs.webkit.org/show_bug.cgi?id=66198 Source/WebCore: Created a new LayoutState constructor for the RenderFlowThread. It will set m_isPaginated to true and force a pageHeight if 1. The actual pageHeight is not used, because pageLogicalHeightForOffset will actually redirect the call to RenderFlowThread. Removed some of the duplicate code that calculated the page logical offset. Added new methods like logicalPageOffset, pageLogicalHeightForOffset, pageRemainingLogicalHeightForOffset. There are still some issues related to incremental layout and different region widths. Those issues will be addressed in different patches. Reviewed by David Hyatt. Tests: fast/regions/text-region-breaks.html fast/regions/text-region-split-horizontal-bt.html fast/regions/text-region-split-vertical-rl.html fast/regions/text-region-split-vertical.html fast/regions/text-region-split.html * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): * rendering/LayoutState.h: (WebCore::LayoutState::LayoutState): (WebCore::LayoutState::isPaginated): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionNewFloats): (WebCore::RenderBlock::adjustForRegionFittingIfNeeded): (WebCore::RenderBlock::nextPageLogicalTopExcludingBoundaryPoint): (WebCore::RenderBlock::nextPageLogicalTopIncludingBoundaryPoint): (WebCore::inNormalFlow): (WebCore::RenderBlock::applyBeforeBreak): (WebCore::RenderBlock::applyAfterBreak): (WebCore::RenderBlock::logicalPageOffset): (WebCore::RenderBlock::pageLogicalHeightForOffset): (WebCore::RenderBlock::pageRemainingLogicalHeightForOffset): (WebCore::RenderBlock::adjustForUnsplittableChild): (WebCore::RenderBlock::adjustLinePositionForPagination): * rendering/RenderBlock.h: * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::layout): (WebCore::RenderFlowThread::regionLogicalHeightForLine): (WebCore::RenderFlowThread::regionRemainingLogicalHeightForLine): * rendering/RenderFlowThread.h: * rendering/RenderView.cpp: (WebCore::RenderView::pushLayoutState): * rendering/RenderView.h: (WebCore::LayoutStateMaintainer::LayoutStateMaintainer): (WebCore::LayoutStateMaintainer::push): LayoutTests: Also updated the results for some older tests that now work correctly. Reviewed by David Hyatt. * fast/regions/resources/helper.js: (isDebugEnabled): (assertEqualRects): (testBoundingRects): (assertRectContains): (addPageLevelDebugBox): (testContentToRegionsMapping): * fast/regions/text-region-breaks-expected.txt: Added. * fast/regions/text-region-breaks.html: Added. * fast/regions/text-region-split-expected.txt: Added. * fast/regions/text-region-split-horizontal-bt-expected.txt: Added. * fast/regions/text-region-split-horizontal-bt.html: Added. * fast/regions/text-region-split-vertical-expected.txt: Added. * fast/regions/text-region-split-vertical-rl-expected.txt: Added. * fast/regions/text-region-split-vertical-rl.html: Added. * fast/regions/text-region-split-vertical.html: Added. * fast/regions/text-region-split.html: Added. * fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt: * fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.txt: * fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.txt: * fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.txt: * fast/repaint/japanese-rl-selection-repaint-in-regions.html: * platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: * platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Canonical link: https://commits.webkit.org/84134@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
27 changed files
with
612 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
|
||
<style> | ||
#content { -webkit-flow: 'flow'; } | ||
.region { content: -webkit-from-flow("flow"); } | ||
.finished #content, .finished .region { display: none; } | ||
|
||
#region1 { width: 70px; height: 60px; } | ||
#region2 { width: 200px; height: 100px; } | ||
#region3 { width: 110px; height: 120px; } | ||
#region4 { width: 220px; height: 100px; } | ||
#region5 { width: 200px; height: 140px; } | ||
</style> | ||
|
||
<div id="content"> | ||
<div style="-webkit-region-break-after: always"><b class="check region1">Region 1</b></div> | ||
|
||
<div> | ||
<div> | ||
<div style="-webkit-region-break-after: always"> | ||
<div> | ||
<b class="check region2">Region 2</b> | ||
<div style="-webkit-region-break-before: always; margin-top:35px;"><b class="check region3">Region 3</b></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div><b class="check region4">Region 4</b></div> | ||
|
||
|
||
<div style="-webkit-region-break-inside: avoid;"> | ||
<b class="check region5 start">Start of region 5.</b> Do not split these lines. Do not split these lines. Do not split these lines. Do not split these lines. Do not split these lines. Do not split these lines. Do not split these lines. <b class="check region5 end">End of region 5.</b> | ||
</div> | ||
|
||
</div> | ||
|
||
<div id="region1" class="region"></div> | ||
<div id="region2" class="region"></div> | ||
<div id="region3" class="region"></div> | ||
<div id="region4" class="region"></div> | ||
<div id="region5" class="region"></div> | ||
|
||
<script src="resources/helper.js"></script> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
if (testContentToRegionsMapping()) | ||
document.body.className = "finished"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
|
||
<style> | ||
html { -webkit-writing-mode: horizontal-bt; } | ||
|
||
#content { -webkit-flow: 'flow'; } | ||
.region { content: -webkit-from-flow("flow"); } | ||
.finished #content, .finished .region { display: none; } | ||
|
||
#region1 { width: 70px; height: 60px; } | ||
#region2 { width: 200px; height: 100px; } | ||
#region3 { width: 110px; height: 120px; } | ||
#region4 { width: 220px; height: 100px; } | ||
#region5 { width: 110px; height: 200px; } | ||
#region6 { width: 300px; height: 120px; } | ||
</style> | ||
|
||
<div id="content"> | ||
<p style="-webkit-region-break-after: always"><b class="check region1">Text in region 1.</b> This paragraph has "<i>-webkit-region-break-after: always</i>". <b class="check region2">There should be nothing in this region after this line.</b></p> | ||
|
||
<p><b class="check region3">First element in the region 3.</b> Some text inside a flow. Some text inside a flow. Some text inside a flow. <b class="check region4">Text in region 4.</b> </p> | ||
|
||
<p> | ||
<!-- Using the paragraph element to test nested blocks region-breaks. --> | ||
<div><span class="check region4">Simple line in region 4.</span></div> | ||
<div style="-webkit-margin-before:50px;"><b class="check region5">First line in region 5.</b> This paragraph displays in region 5 because it has a margin-top, which is too high to fit in the previous region.</div> | ||
<div style="-webkit-region-break-before: always"><b class="check region6">First line in region 6.</b> This paragraph uses "<i>-webkit-region-break-before: always</i>".</div> | ||
</p> | ||
</div> | ||
|
||
<div id="region1" class="region"></div> | ||
<div id="region2" class="region"></div> | ||
<div id="region3" class="region"></div> | ||
<div id="region4" class="region"></div> | ||
<div id="region5" class="region"></div> | ||
<div id="region6" class="region"></div> | ||
|
||
<script src="resources/helper.js"></script> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
if (testContentToRegionsMapping()) | ||
document.body.className = "finished"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
|
||
<style> | ||
html { -webkit-writing-mode: vertical-rl; } | ||
|
||
#content { -webkit-flow: 'flow'; } | ||
.region { content: -webkit-from-flow("flow"); } | ||
.finished #content, .finished .region { display: none; } | ||
|
||
#region1 { width: 70px; height: 60px; } | ||
#region2 { width: 200px; height: 100px; } | ||
#region3 { width: 110px; height: 120px; } | ||
#region4 { width: 220px; height: 100px; } | ||
#region5 { width: 110px; height: 200px; } | ||
#region6 { width: 300px; height: 120px; } | ||
</style> | ||
|
||
<div id="content"> | ||
<p style="-webkit-region-break-after: always"><b class="check region1">Text in region 1.</b> This paragraph has "<i>-webkit-region-break-after: always</i>". <b class="check region2">There should be nothing in this region after this line.</b></p> | ||
|
||
<p><b class="check region3">First element in the region 3.</b> Some text inside a flow. Some text inside a flow. Some text inside a flow. <b class="check region4">Text in region 4.</b> </p> | ||
|
||
<p> | ||
<!-- Using the paragraph element to test nested blocks region-breaks. --> | ||
<div><span class="check region4">Simple line in region 4.</span></div> | ||
<div style="-webkit-margin-before:80px;"><b class="check region5">First line in region 5.</b> This paragraph displays in region 5 because it has a margin-top, which is too high to fit in the previous region.</div> | ||
<div style="-webkit-region-break-before: always"><b class="check region6">First line in region 6.</b> This paragraph uses "<i>-webkit-region-break-before: always</i>".</div> | ||
</p> | ||
</div> | ||
|
||
<div id="region1" class="region"></div> | ||
<div id="region2" class="region"></div> | ||
<div id="region3" class="region"></div> | ||
<div id="region4" class="region"></div> | ||
<div id="region5" class="region"></div> | ||
<div id="region6" class="region"></div> | ||
|
||
<script src="resources/helper.js"></script> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
if (testContentToRegionsMapping()) | ||
document.body.className = "finished"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
|
||
<style> | ||
html { -webkit-writing-mode: vertical-lr; } | ||
|
||
#content { -webkit-flow: 'flow'; } | ||
.region { content: -webkit-from-flow("flow"); } | ||
.finished #content, .finished .region { display: none; } | ||
|
||
#region1 { height: 70px; width: 60px; } | ||
#region2 { height: 200px; width: 150px; } | ||
#region3 { height: 110px; width: 120px; } | ||
#region4 { height: 220px; width: 100px; } | ||
#region5 { height: 110px; width: 200px; } | ||
#region6 { height: 300px; width: 120px; } | ||
</style> | ||
|
||
<div id="content"> | ||
<p style="-webkit-region-break-after: always"><b class="check region1">Text in region 1.</b> This paragraph has "<i>-webkit-region-break-after: always</i>". <b class="check region2">There should be nothing in this region after this line.</b></p> | ||
|
||
<p><b class="check region3">First element in the region 3.</b> Some text inside a flow. Some text inside a flow. Some text inside a flow. <b class="check region4">Text in region 4.</b> </p> | ||
|
||
<p> | ||
<!-- Using the paragraph element to test nested blocks region-breaks. --> | ||
<div><span class="check region4">Simple line in region 4.</span></div> | ||
<div style="-webkit-margin-before:50px;"><b class="check region5">First line in region 5.</b> This paragraph displays in region 5 because it has a margin-top, which is too high to fit in the previous region.</div> | ||
<div style="-webkit-region-break-before: always"><b class="check region6">First line in region 6.</b> This paragraph uses "<i>-webkit-region-break-before: always</i>".</div> | ||
</p> | ||
</div> | ||
|
||
<div id="region1" class="region"></div> | ||
<div id="region2" class="region"></div> | ||
<div id="region3" class="region"></div> | ||
<div id="region4" class="region"></div> | ||
<div id="region5" class="region"></div> | ||
<div id="region6" class="region"></div> | ||
|
||
<script src="resources/helper.js"></script> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
if (testContentToRegionsMapping()) | ||
document.body.className = "finished"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
|
||
<style> | ||
#content { -webkit-flow: 'flow'; } | ||
.region { content: -webkit-from-flow("flow"); } | ||
.finished #content, .finished .region { display: none; } | ||
|
||
#region1 { width: 70px; height: 60px; } | ||
#region2 { width: 200px; height: 100px; } | ||
#region3 { width: 110px; height: 120px; } | ||
#region4 { width: 220px; height: 100px; } | ||
#region5 { width: 110px; height: 200px; } | ||
#region6 { width: 300px; height: 120px; } | ||
</style> | ||
|
||
<div id="content"> | ||
<p style="-webkit-region-break-after: always"><b class="check region1">Text in region 1.</b> This paragraph has "<i>-webkit-region-break-after: always</i>". <b class="check region2">There should be nothing in this region after this line.</b></p> | ||
|
||
<p><b class="check region3">First element in the region 3.</b> Some text inside a flow. Some text inside a flow. Some text inside a flow. <b class="check region4">Text in region 4.</b> </p> | ||
|
||
<p> | ||
<!-- Using the paragraph element to test nested blocks region-breaks. --> | ||
<div><span class="check region4">Simple line in region 4.</span></div> | ||
<div style="margin-top:50px;"><b class="check region5">First line in region 5.</b> This paragraph displays in region 5 because it has a margin-top, which is too high to fit in the previous region.</div> | ||
<div style="-webkit-region-break-before: always"><b class="check region6">First line in region 6.</b> This paragraph uses "<i>-webkit-region-break-before: always</i>".</div> | ||
</p> | ||
</div> | ||
|
||
<div id="region1" class="region"></div> | ||
<div id="region2" class="region"></div> | ||
<div id="region3" class="region"></div> | ||
<div id="region4" class="region"></div> | ||
<div id="region5" class="region"></div> | ||
<div id="region6" class="region"></div> | ||
|
||
<script src="resources/helper.js"></script> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
if (testContentToRegionsMapping()) | ||
document.body.className = "finished"; | ||
</script> |
Oops, something went wrong.