NEW 206914
CanvasRenderingContext2DBase::drawImage() should use the destRect values to draw the SVG image.
https://bugs.webkit.org/show_bug.cgi?id=206914
Summary CanvasRenderingContext2DBase::drawImage() should use the destRect values to d...
zalan
Reported 2020-01-28 16:33:48 PST
see fast/hidpi/image-srcset-relative-svg-canvas-2x.html and rdar://problem/58580461
Attachments
test case (970 bytes, text/html)
2020-01-30 14:42 PST, Said Abou-Hallawa
no flags
test case (961 bytes, text/html)
2020-01-30 14:44 PST, Said Abou-Hallawa
no flags
Radar WebKit Bug Importer
Comment 1 2020-01-30 11:24:53 PST
Said Abou-Hallawa
Comment 2 2020-01-30 14:42:29 PST
Created attachment 389291 [details] test case Open the attached test case in Safari, in Chrome and in FireFox. The three browsers have different layout and rendering of the test case. This test case has an SVG image embedded inside an <img> element. The SVG does not have intrinsic size. But the css size of the <img> element is (100x50). The <img> element is then drawn to the canvas to (200x100) rectangle. This is how the three browsers behave: 1. Safari: the <img> element intrinsic size (100x50) is used for doing the SVG layout when it's drawing as an embedded element inside the <img> element and when it is drawn to the canvas through the drawImage() API. 2. Chrome: the <img> element intrinsic size (100x50) is used for doing the SVG layout when drawing it in as an embedded element inside the <img> element. But the destRect (200x100) of the canvas drawImage() API is used to do the SVG layout when it is drawn to the canvas through the drawImage() API. 3. FireFox: I am not sure how the intrinsic size of the SVG is set to (200x100). And it seems FireFox does not support drawing an SVG image to canvas. I looked for a specification on how this should work but I could not find anything.
Said Abou-Hallawa
Comment 3 2020-01-30 14:44:57 PST
Created attachment 389292 [details] test case
Said Abou-Hallawa
Comment 4 2020-04-01 15:24:30 PDT
Note You need to log in before you can comment on or make changes to this bug.