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)

62 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: r_kato, Unassigned)

Details

Attachments

(1 file)

Attached file index.html
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.
Component: Untriaged → Canvas: 2D
Product: Firefox → Core
An affected web site: https://vaaaaanquish.jp/bank
(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
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
I talked with :birtles. Then we concluded that it seems better to align to whatwg spec and update MDN.
:dholbert, can you comment to the bug? Thanks.
Flags: needinfo?(dholbert)
Whiteboard: [gfx-noted]
Priority: -- → P3
(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)
I just wanted to check if comment 5 is reasonable. Thanks.
Flags: needinfo?(sotaro.ikeda.g)
Whiteboard: [gfx-noted]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: