mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Handle nonexistent images in CanvasRenderingContext2D.createPattern()
This commit is contained in:
parent
e3c91f7c49
commit
3ec848f4a8
12 changed files with 37 additions and 16 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -5754,7 +5754,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "surfman-chains"
|
name = "surfman-chains"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/asajeffrey/surfman-chains?branch=multi#80a71b1a2df71ae70c3c194d0af40b8ebf72968a"
|
source = "git+https://github.com/asajeffrey/surfman-chains?branch=multi#e775b8c7807659958a4f20cf8e6eca4290f35124"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"euclid",
|
"euclid",
|
||||||
"fnv",
|
"fnv",
|
||||||
|
|
|
@ -167,13 +167,10 @@ impl HTMLImageElement {
|
||||||
// https://html.spec.whatwg.org/multipage/#check-the-usability-of-the-image-argument
|
// https://html.spec.whatwg.org/multipage/#check-the-usability-of-the-image-argument
|
||||||
pub fn is_usable(&self) -> Fallible<bool> {
|
pub fn is_usable(&self) -> Fallible<bool> {
|
||||||
// If image has an intrinsic width or intrinsic height (or both) equal to zero, then return bad.
|
// If image has an intrinsic width or intrinsic height (or both) equal to zero, then return bad.
|
||||||
match &self.current_request.borrow().image {
|
if let Some(image) = &self.current_request.borrow().image {
|
||||||
Some(image) => {
|
|
||||||
if image.width == 0 || image.height == 0 {
|
if image.width == 0 || image.height == 0 {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
None => return Ok(false),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.current_request.borrow().state {
|
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