mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #25940 - pylbrecht:image.handling, r=jdm
Handle nonexistent images in CanvasRenderingContext2D.createPattern() <!-- 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. -->
This commit is contained in:
commit
5737db81f9
11 changed files with 36 additions and 15 deletions
|
@ -167,13 +167,10 @@ impl HTMLImageElement {
|
|||
// https://html.spec.whatwg.org/multipage/#check-the-usability-of-the-image-argument
|
||||
pub fn is_usable(&self) -> Fallible<bool> {
|
||||
// If image has an intrinsic width or intrinsic height (or both) equal to zero, then return bad.
|
||||
match &self.current_request.borrow().image {
|
||||
Some(image) => {
|
||||
if image.width == 0 || image.height == 0 {
|
||||
return Ok(false);
|
||||
}
|
||||
},
|
||||
None => return Ok(false),
|
||||
if let Some(image) = &self.current_request.borrow().image {
|
||||
if image.width == 0 || image.height == 0 {
|
||||
return Ok(false);
|
||||
}
|
||||
}
|
||||
|
||||
match self.current_request.borrow().state {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[2d.drawImage.broken.html]
|
||||
[Canvas test: 2d.drawImage.broken]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.broken.html]
|
||||
[Canvas test: 2d.pattern.image.broken]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.pattern.image.nonexistent.html]
|
||||
[Canvas test: 2d.pattern.image.nonexistent]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.zeroheight.html]
|
||||
[Canvas test: 2d.pattern.image.zeroheight]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.zerowidth.html]
|
||||
[Canvas test: 2d.pattern.image.zerowidth]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.drawImage.broken.html]
|
||||
[Canvas test: 2d.drawImage.broken]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.broken.html]
|
||||
[Canvas test: 2d.pattern.image.broken]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.pattern.image.nonexistent.html]
|
||||
[Canvas test: 2d.pattern.image.nonexistent]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.zeroheight.html]
|
||||
[Canvas test: 2d.pattern.image.zeroheight]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.pattern.image.zerowidth.html]
|
||||
[Canvas test: 2d.pattern.image.zerowidth]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue