[CSS Shapes] Image valued shape size and position should conform to the spec
https://bugs.webkit.org/show_bug.cgi?id=123295
Reviewed by Andreas Kling.
Source/WebCore:
Implement image valued shape-outside scaling and translation per the spec,
http://dev.w3.org/csswg/css-shapes/#shapes-from-image:
"The image is sized and positioned as if it were a replaced element whose
specified width and height are the same as the element’s used content box size."
This change doesn't completely fulfill the spec, it's limited to image elements
and shape-outside.
Tests: fast/shapes/shape-outside-floats/shape-outside-image-fit-001.html
fast/shapes/shape-outside-floats/shape-outside-image-fit-002.html
fast/shapes/shape-outside-floats/shape-outside-image-fit-003.html
fast/shapes/shape-outside-floats/shape-outside-image-fit-004.html
* rendering/shapes/Shape.h:
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
Added an imageRect parameter which specifies where the shape image is to
appear relative to the content box. The imageRect implies both scaling and
translation of the shape image.
* rendering/shapes/ShapeInfo.cpp:
(WebCore::ShapeInfo<RenderType>::computedShape):
(WebCore::getShapeImageRect):
For replaced elements, compute the shape's imageRect with
RenderReplaced::replacedContentRect().
LayoutTests:
* fast/shapes/shape-outside-floats/shape-outside-image-fit-001-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-001.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-002-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-002.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-003-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-003.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-004-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-fit-004.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162659
268f45cc-cd09-0410-ab3c-
d52691b4dbfc