Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nonexistent images in CanvasRenderingContext2D.createPattern() #25940

Merged
merged 1 commit into from Mar 13, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Handle nonexistent images in CanvasRenderingContext2D.createPattern()

  • Loading branch information
pylbrecht committed Mar 13, 2020
commit 3ec848f4a81b9162e74a7d4fe662b3a701fbe3ad

Some generated files are not rendered by default. Learn more.

@@ -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

This file was deleted.

@@ -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

This file was deleted.

@@ -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

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.