Closed Bug 1684689 Opened 4 years ago Closed 4 years ago

WPT test fails for html/canvas/element/pixel-manipulation/2d.imageData.create2.zero.html

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: aryanagal98, Assigned: aryanagal98)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

WPT test for html/canvas/element/pixel-manipulation/2d.imageData.create2.zero.html fails

FAIL message: assert_throws_dom: function "function() { ctx.createImageData(0.99, 10); }" did not throw

Cross-browser tests (as of bug report):

Chrome Edge Firefox Safari
PASS PASS FAIL FAIL
Blocks: 1646754

Shifted the zero-check after width and height are clamped to int32s. Fixes the
use case where width and height are floats > 0 but < 1. These values are
clamped to 0, but no error is thrown, as opposed to the desired behavior.
Changed corresponding test to reflect that it is expected to PASS.

Assignee: nobody → aryanagal98
Attachment #9195061 - Attachment description: Bug 1684689 - WPT test fails for html/canvas/element/pixel-manipulation/2d.imageData.create2.zero.html r?emilio → Bug 1684689 - Check for 0 size after clamping in CanvasRenderingContext2D.createImageData r?emilio
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/636bed8f02dc
Check for 0 size after clamping in CanvasRenderingContext2D.createImageData r=emilio
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/f70abb51ec6d
Fix a test that started failing and checked something against the spec.

This fixes the DAMP failures and effectively preserves behavior.

(In reply to Atila Butkovits from comment #5)

Failure log: https://treeherder.mozilla.org/logviewer?job_id=325674078&repo=autoland

Code snippet:

[task 2021-01-02T22:56:17.593Z] 22:56:17 ERROR - PID 3956 | Handler function threw an exception: TypeError: can't access property "first", timings.REQUEST_HEADER is undefined
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | Stack: _getBlockedTiming@resource://devtools/server/actors/network-monitor/network-observer.js:1226:7
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | _setupHarTimings@resource://devtools/server/actors/network-monitor/network-observer.js:1419:31
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | _onTransactionClose@resource://devtools/server/actors/network-monitor/network-observer.js:1210:27
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | _dispatchActivity@resource://devtools/server/actors/network-monitor/network-observer.js:632:14
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | NetworkObserver.prototype.observeActivity<@resource://devtools/server/actors/network-monitor/network-observer.js:738:12
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:103:22
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | Line: 1226, column: 7
[task 2021-01-02T22:56:17.593Z] 22:56:17 INFO - PID 3956 | console.error: (new TypeError("can't access property "first", timings.REQUEST_HEADER is undefined", "resource://devtools/server/actors/network-monitor/network-observer.js", 1226))

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/442421e347a1
Fix usage of createImageData in devtools. r=jdescottes
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9f813973b02b
Check for 0 size after clamping in CanvasRenderingContext2D.createImageData r=emilio
Flags: needinfo?(aryanagal98)
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
See Also: → 1685459
You need to log in before you can comment on or make changes to this bug.