If the value of a shape is an SVG image whose root element has a relative size, the image isn't sized correctly. The source of the problem, as best I understand it, is that we're not setting the SVGImage's "containerSize", which SVGImage::draw() depends on. What happens instead is that SVGImage::containerSize() returns 300x150, which is the "CSS default intrinsic size". I think what needs to be done is the following. Once the shape's SVG image has been loaded and just before it's draw it into a temporary ImageBuffer so that it can be converted it into a RasterShape: shapeImageResource.setContainerSizeForRenderer(shapeImageResourceClient, referenceBoxRelativeSize); imageToDraw = shapeImageResource.imageForRenderer(shapeImageResourceClient); In this case shapeImageResourceClient is the existing ShapeInfo object, which will have to become an ImageResourceClient. This can't work at the moment because the ImageResource::imageForRenderer() method currently uses a RenderObject* as the SVGImageCache key. It looks like that could be safely changed to ImageResourceClient.
Created attachment 224525 [details] Test case.
Created attachment 226174 [details] Patch 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.
Comment on attachment 226174 [details] Patch Attachment 226174 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4806239699599360 New failing tests: editing/unsupported-content/list-delete-001.html editing/unsupported-content/table-type-after.html editing/unsupported-content/list-type-after.html editing/unsupported-content/list-type-before.html editing/unsupported-content/table-type-before.html
Created attachment 226185 [details] Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-16 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 226174 [details] Patch Clearing flags on attachment: 226174 Committed r165387: <http://trac.webkit.org/changeset/165387>
All reviewed patches have been landed. Closing bug.