[CSS Shapes] Shape Outside should relayout when set dynamically
https://bugs.webkit.org/show_bug.cgi?id=122197
Reviewed by Alexandru Chiculita.
Source/WebCore:
Tests: fast/shapes/shape-outside-floats/shape-outside-dynamic-shape.html
fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-overhang.html
When shape outside is modified, dependent content needs to relayout. This patch
removes the float from the float lists and marks dependents for layout using
RenderBox::removeFloatingOrPositionedChildFromBlockLists(). This is the same
method used when switching from float: left to float: right and vice versa
(see RenderElement::styleWillChange).
(WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange): Mark shape-outside dependents
for layout.
(WebCore::RenderBox::markShapeOutsideDependentsForLayout): Mark all the items that may be
affected by this shape-outside for relayout.
LayoutTests:
Test that a shape can be dynamically added, modified, or removed and that
content does a proper relayout.
- fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-overhang-expected.html: Added.
- fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-overhang.html: Added.
- fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-expected.html: Added.
- fast/shapes/shape-outside-floats/shape-outside-dynamic-shape.html: Added.