The web platform test wpt/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_12.html checks the proper clipping of the image when the source sx and sy are negative (Please see the attached test).
Safari draws the image as expected in the test reference, that is, a 25x25 rect starting from 0,0.
Chromium, Firefox and Opera do not pass the test. They draw the 25x25 rect starting from 25,25.
IE and Edge do not pass the test. They do not draw the image.
The spec says: "The source rectangle is the rectangle whose corners are the four points (sx, sy), (sx+sw, sy), (sx+sw, sy+sh), (sx, sy+sh)."
So the source rectangle will be (-25, -25) -> (25, 25). The question is, should the rectangle be clipped, as Safari does, or not, as Chromium, Firefox and Opera do?
|
Deleted:
2x2.png
1.5 KB
|
|
Deleted:
drawImageNegativeSrcXY.html
1.0 KB
|
|
Deleted:
Chromium.png
19.0 KB
|
|
Deleted:
Firefox.png
14.6 KB
|
|
Deleted:
Opera.png
20.2 KB
|
|
Deleted:
Safari.png
65.5 KB
|
|
Deleted:
IE.PNG
7.9 KB
|
|
Deleted:
Edge.PNG
4.8 KB
|
Comment 1 by f...@opera.com
, Sep 14 2017