[CSS Exclusions] Implement empty segments for multiple-segment shape-insides
https://bugs.webkit.org/show_bug.cgi?id=100049
Reviewed by David Hyatt.
Source/WebCore:
Content should not overflow a shape-inside segment, even if that means no content
will be placed in that segment. Overflow may be pushed to outside the shape. This
patch removes the restriction that every line must consume at least some text
input while inside a shape-inside. Content that does not fit is pushed down until
it does, either inside the shape or just below it.
Test: fast/exclusions/shape-inside/shape-inside-empty-segments.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::constructBidiRunsForSegment): Do not include empty segments for
consideration, as the actual BidiRuns construction expects to consume at
least one character.
(WebCore::constructBidiRunsForLine): Ditto.
(WebCore::firstPositiveWidth): Find the first positive word measurement width,
as there may be some empty word break measurements inserted.
(WebCore::adjustLogicalLineTop): Move the current line down, if necessary, to
fit it within the shape inside.
(WebCore::RenderBlock::layoutRunsAndFloatsInRange): If nothing fit in the
current segment, find the first available position for the smallest item
at the beginning of the text.
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Return an empty segment
for a line that is inside the shape, but has no segments.
(WebCore::RenderBlock::LineBreaker::nextSegmentBreak): Do not consume
input to meet minimum size requirements if you are inside a shape.
LayoutTests:
Testing that shape-insides do not place content where it will not fit. Also
fixing up some previous tests and expectations.
* fast/exclusions/resources/multi-segment-polygon.js:
(simulateWithText): Enable multi-line shape expectations using arrays.
* fast/exclusions/resources/simple-rectangle.js:
(createRectangleTest): Add overflow: break-word property to tests.
(createRectangleTestResult): Ditto.
* fast/exclusions/shape-inside/shape-inside-empty-expected.html: Adjust results
for tests where content should be pushed down.
* fast/exclusions/shape-inside/shape-inside-empty-segments-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-empty-segments.html: Added.
* fast/exclusions/shape-inside/shape-inside-empty.html: Shapes with height but
no width should still push content down below the shape.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
9 files changed