Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake CanvasRenderingContext2D.createPattern() return null for incomplete images #25710
Conversation
highfive
commented
Feb 7, 2020
|
Heads up! This PR modifies the following files:
|
|
These changes are based on #25675. |
|
@bors-servo try=wpt |
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
r? @jdm |
|
|
Looks like this test is expecting a throw on an image it thinks is broken, and possibly getting the new null instead? |
|
It would be very helpful to know how |
I've never considered this an option. It would spare me the debugging though. |
|
@bors-servo retry |
|
@bors-servo try=wpt |
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
I wasn't checking for a broken state in case the |
|
|
This is weird. It seems From the spec of drawImage():
From the spec of createPattern():
From the spec of checking the usability of the image argument:
To me it looks like |
|
Since looking at other browsers' behavior for reference seems the common thing to do, I'm a little lost on how to proceed. |
|
It seems |
|
@bors-servo try=wpt |
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
@bors-servo r+ |
|
|
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
@bors-servo retry |
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
@bors-servo retry |
Make CanvasRenderingContext2D.createPattern() return null for incomplete images <!-- Please describe your changes on the following line: --> `createPattern()` should return `null` if the passed `image` argument is not usable. References: - https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern - https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
pylbrecht commentedFeb 7, 2020
createPattern()should returnnullif the passedimageargument is not usable.References:
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors