[CSS Shapes] SVG Image valued shape fails if root element's size is relative
https://bugs.webkit.org/show_bug.cgi?id=128983
Reviewed by Simon Fraser.
Source/WebCore:
When creating a shape based on an Image, compute its dimensions using
RenderBoxModelObject::calculateImageIntrinsicDimensions(), then set the
ImageResource's containerSize, and then use imageForRenderer() to get the
image to be drawn. The first step resolves SVG Image relative sizes, the
second step creates and caches an SVGImageForContainer with the correct
containerSize, and the last step retrieves the SVGImageForContainer.
Test: fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html
* rendering/RenderBoxModelObject.h: Publicized calculateImageIntrinsicDimensions() and its enum.
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/shapes/Shape.h:
* rendering/shapes/ShapeInfo.cpp:
(WebCore::getShapeImageAndRect):
(WebCore::ShapeInfo<RenderType>::computedShape):
LayoutTests:
Verify that an SVG Image valued shape-outside with a relatively sized SVG root element
generates a shape with the correct size.
* fast/shapes/shape-outside-floats/shape-outside-relative-size-svg-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed