[CSSRegions] Regions should not slice line box rendering
authorachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2011 02:56:19 +0000 (02:56 +0000)
committerachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2011 02:56:19 +0000 (02:56 +0000)
commitcfb08f5045adfa0bcb68e5b4adb495ccca45409b
tree88a3afb877629ce191378a65e9c4641a330959fd
parent64debe32bdb196273ce72b5a394cb2811f720aac
[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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/resources/helper.js
LayoutTests/fast/regions/text-region-breaks-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/text-region-breaks.html [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-horizontal-bt-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-horizontal-bt.html [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-vertical-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-vertical-rl-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-vertical-rl.html [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split-vertical.html [new file with mode: 0644]
LayoutTests/fast/regions/text-region-split.html [new file with mode: 0644]
LayoutTests/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt
LayoutTests/fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.txt
LayoutTests/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.txt
LayoutTests/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.txt
LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png
LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/LayoutState.cpp
Source/WebCore/rendering/LayoutState.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h