Closed Bug 1672887 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 26246 - Fix Canvas drawImage tests not to expect INDEX_SIZE_ERR when source width/height is zero (fixes #2835)

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 26246 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/26246
Details from upstream follow.

b'Tooru Fujisawa <arai_a@mac.com>' wrote:

Fix Canvas drawImage tests not to expect INDEX_SIZE_ERR when source width/height is zero (fixes #2835)

From https://bugzilla.mozilla.org/show_bug.cgi?id=1669090

the spec says the following:

https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage

When the drawImage() method is invoked, the user agent must run these steps:
...
  4. ...
      If the sx, sy, sw, and sh arguments are omitted, then they must default to 0, 0, the image's intrinsic width in image pixels, and the image's intrinsic height in image pixels, respectively. 
      ....
  5. If one of the sw or sh arguments is zero, then return. Nothing is painted.

So, if source image's width/height is zero, drawImage should just return without doing anything.
2d.drawImage.zerosource.html testcase is already following the spec.
applied the same change to 2d.drawImage.zerosource.image.html testcase

Both Chrome and Safari don't throw.
Firefox currently throws but https://bugzilla.mozilla.org/show_bug.cgi?id=1669090 patch will fix it not to throw.

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests and 1 subtests

Status Summary

Firefox

OK : 5
FAIL: 5

Chrome

OK : 5
PASS: 5

Safari

OK : 5
PASS: 1
FAIL: 4

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html
drawImage with zero-sized source rectangle from image draws nothing without exception: FAIL

New Tests That Don't Pass

/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.html
drawImage with zero-sized source rectangle draws nothing without exception: FAIL (Chrome: PASS, Safari: FAIL)
/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html
drawImage with zero-sized source rectangle from image draws nothing without exception: FAIL (Chrome: PASS, Safari: PASS)
/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html
drawImage with zero-sized source rectangle from image draws nothing without exception: FAIL (Chrome: PASS, Safari: FAIL)
/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.worker.html
drawImage with zero-sized source rectangle from image draws nothing without exception: FAIL (Chrome: PASS, Safari: FAIL)
/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.html
drawImage with zero-sized source rectangle draws nothing without exception: FAIL (Chrome: PASS, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ef12989e52b
[wpt PR 26246] - Fix Canvas drawImage tests not to expect INDEX_SIZE_ERR when source width/height is zero (fixes #2835), a=testonly
https://hg.mozilla.org/integration/autoland/rev/3609ac335150
[wpt PR 26246] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.