Closed Bug 1565991 Opened 5 years ago Closed 5 years ago

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

Categories

(Core :: Graphics: Canvas2D, 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

(1 file, 1 obsolete file)

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
Upstream PR merged by moz-wptsync-bot
Regressions: 1614225
Attachment #9095053 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: