Open
Bug 1497275
Opened 7 years ago
Updated 3 years ago
CanvasRenderingContext2D.drawImage (9 args) throws IndexSizeError when 0 is given to sWidth or sHeight
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
UNCONFIRMED
People
(Reporter: r_kato, Unassigned)
Details
Attachments
(1 file)
|
2.21 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0
Steps to reproduce:
STR:
- Open the attached `index.html` file in Firefox (62 - 64)
Actual results:
3 `IndexSizeError` are thrown, though it seems the relevant spec does not state that.
spec: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage
That errors are caused by test cases where 0 is given to `sWidth` or `sHeight` in drawImage()
Google Chrome 69 and Safari 12 don't cause this issue.
Expected results:
Throw no errors.
| Reporter | ||
Updated•7 years ago
|
Component: Untriaged → Canvas: 2D
Product: Firefox → Core
| Reporter | ||
Comment 1•7 years ago
|
||
An affected web site: https://vaaaaanquish.jp/bank
Comment 2•7 years ago
|
||
There is a similar issue in stackoverflow
https://stackoverflow.com/questions/19338032/canvas-indexsizeerror-index-or-size-is-negative-or-greater-than-the-allowed-a
Comment 3•7 years ago
|
||
(In reply to Ryo Kato [:r_kato] from comment #0)
>
> spec:
> https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage
w3c spec still has "If the one of the source rectangle dimensions is zero, throws an IndexSizeError exception."
https://www.w3.org/TR/2dcontext/#dom-context-2d-drawimage
Comment 4•7 years ago
|
||
MDN has an explanation. "INDEX_SIZE_ERR If the canvas or source rectangle width or height is zero."
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage#Exceptions_thrown
Comment 5•7 years ago
|
||
I talked with :birtles. Then we concluded that it seems better to align to whatwg spec and update MDN.
Updated•7 years ago
|
Whiteboard: [gfx-noted]
Updated•7 years ago
|
Priority: -- → P3
Comment 7•7 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #6)
> :dholbert, can you comment to the bug? Thanks.
Do you have a particular question that you'd like me to comment on?
(Your conclusion in comment 5 sounds reasonable; the WHATWG spec is the more authoritative one, when it comes to HTML element behavior.)
Flags: needinfo?(dholbert) → needinfo?(sotaro.ikeda.g)
Comment 8•7 years ago
|
||
I just wanted to check if comment 5 is reasonable. Thanks.
Flags: needinfo?(sotaro.ikeda.g)
Updated•7 years ago
|
Whiteboard: [gfx-noted]
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•