Closed Bug 1565991 Opened 8 months ago Closed 5 months ago

Calling createPattern with `new Image()` must return null

Categories

(Core :: Canvas: 2D, defect, P3)

69 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: saschanaz, Assigned: ktaeleman)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

document.createElement("canvas").getContext("2d").createPattern(new Image(), "no-repeat")

Currently the code throws instead of returning null.

Component: DOM: Core & HTML → Canvas: WebGL
Component: Canvas: WebGL → Canvas: 2D
Summary: Calling createPattern with a broken image must return null → Calling createPattern with `new Image()` must return null

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

It seems new Image() is immediately considered as broken 🤔

Priority: -- → P3
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f69e1e9da360
Ensure calling createPattern with `new Image()` returns null. r=jrmuizel
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/18697 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR was closed without merging
Flags: needinfo?(lsalzman) → needinfo?(ktaeleman)
Attachment #9085595 - Attachment description: Bug 1565991 - Ensure calling createPattern with `new Image()` returns null. r=jrmuizel → Bug 1565991 - Make createpattern return null instead of throw.
Attachment #9085595 - Attachment description: Bug 1565991 - Make createpattern return null instead of throw. → Bug 1565991 - Make createpattern return null instead of throw. * Deleted test_createPattern_broken.html as it is now irrelevant as this was testing for the broken behavior.
Attachment #9085595 - Attachment description: Bug 1565991 - Make createpattern return null instead of throw. * Deleted test_createPattern_broken.html as it is now irrelevant as this was testing for the broken behavior. → Bug 1565991 - Make createpattern return null instead of throw.
Flags: needinfo?(ktaeleman)
Assignee: nobody → ktaeleman
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2c1a726f2190
Make createpattern return null instead of throw. r=jrmuizel
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5abd597f5d2d
Mark some additional tests as passing. a=wpt-fix
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84e78280c066
Update expectation for 2d.pattern.image.incomplete.emptysrc.html a=wpt-fix
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.