Created attachment 260645 [details] test case Open the attached test case. Result: Two rectangles are drawn. The first one is 10x10 and the second one is 100x100. Expected: The two rectangles should have size of 100x100. Notes: 1. The first rectangle is an <img> tag. Its size is 100x100 and its src is set to a a data uri SVG. 3. The second rectangle is a canvas which loads the same data uri SVG and draws it to a rectangle of 100x100. 2. The SVG does not have an intrinsic size. But it has a viewBox of "0 0 1000 1000". The bug does not happen with the same test case if any of the following happens: 1. The <img> tag is removed (so the canvas does not get the image resource from the cache). 2. The data uri SVG has an intrinsic size. 3. The viewBox is "0 0 100 100".
<rdar://problem/22530820>
Created attachment 261962 [details] Patch
Comment on attachment 261962 [details] Patch Attachment 261962 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/213121 New failing tests: svg/as-image/svg-cached-draw-canvas.html
Created attachment 261965 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Comment on attachment 261962 [details] Patch All the name changes from image to imageElement obscure the substance of the code change. Might be nicer as two separate patches. Looks like this changes the result of the svg/as-image/svg-cached-draw-canvas.html test.
(In reply to comment #5) > Comment on attachment 261962 [details] > Patch > > All the name changes from image to imageElement obscure the substance of the > code change. Might be nicer as two separate patches. I will submit two patches as suggested. > > Looks like this changes the result of the > svg/as-image/svg-cached-draw-canvas.html test. The test fails only on the bots; it passes locally. It happens because of the image smoothing which happens when drawing two colors on the canvas. The pixels on the boundaries get a mixed color. Actually drawing an SVG with a single color on the canvas is sufficient. I was trying to make sure the SVG is scaled down and not clipped. With a single color, there is no difference between scaling and non-clipping. I will try fixing this by setting the context flag imageSmoothingEnabled to false and see if the test passes on the bots.
Created attachment 261995 [details] Patch
Comment on attachment 261995 [details] Patch Attachment 261995 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/218768 New failing tests: svg/as-image/svg-cached-draw-canvas.html
Created attachment 261996 [details] Archive of layout-test-results from ews103 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-mavericks Platform: Mac OS X 10.9.5
The renaming patch is: Committed r190273: <http://trac.webkit.org/changeset/190273>.
Created attachment 261998 [details] Patch
Comment on attachment 261998 [details] Patch Attachment 261998 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/219247 New failing tests: svg/as-image/svg-cached-draw-canvas.html
Created attachment 261999 [details] Archive of layout-test-results from ews101 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-mavericks Platform: Mac OS X 10.9.5
Created attachment 262000 [details] Patch
Created attachment 262002 [details] test case
Comment on attachment 262000 [details] Patch Clearing flags on attachment: 262000 Committed r190274: <http://trac.webkit.org/changeset/190274>
All reviewed patches have been landed. Closing bug.