From 65a21e9badb7fb4672405aa9818cbd60f37677fb Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Thu, 17 Oct 2019 07:08:53 +0200 Subject: [PATCH 01/34] Enable raqote by default --- python/servo/command_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 1a56777f14f..7c82acaa534 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -929,8 +929,8 @@ install them, let us know by filing a bug!") features.append("egl") if with_raqote and "canvas2d-azure" not in features: features.append("canvas2d-raqote") - elif "canvas2d-raqote" not in features: - features.append("canvas2d-azure") + elif "canvas2d-azure" not in features: + features.append("canvas2d-raqote") if with_layout_2020 or (self.config["build"]["layout-2020"] and not with_layout_2013): features.append("layout-2020") elif "layout-2020" not in features: From c8025c914717cd5fb65d17ff6310c29686fb9faa Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Thu, 24 Oct 2019 19:14:28 +0200 Subject: [PATCH 02/34] Don't reuse PathBuilder after calling finish() --- components/canvas/raqote_backend.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index a2f563db346..78b995c60d9 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -563,6 +563,7 @@ impl GenericPathBuilder for PathBuilder { fn get_current_point(&mut self) -> Point2D { let path = self.finish(); + self.0 = Some(path.as_raqote().clone().into()); for op in path.as_raqote().ops.iter().rev() { match op { From d6f46b55130ec762f56aabaa6adb831ca7ac29d5 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 29 Oct 2019 13:18:16 +0100 Subject: [PATCH 03/34] Apply transformation in Path::contains_point() --- components/canvas/raqote_backend.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 78b995c60d9..438689bae03 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -187,8 +187,11 @@ impl Path { )))) } - pub fn contains_point(&self, x: f64, y: f64, _path_transform: &Transform2D) -> bool { - self.as_raqote().contains_point(0.1, x as f32, y as f32) + pub fn contains_point(&self, x: f64, y: f64, path_transform: &Transform2D) -> bool { + self.as_raqote() + .clone() + .transform(path_transform) + .contains_point(0., x as f32, y as f32) } pub fn copy_to_builder(&self) -> Box { From 606ad20544f34d066f1a94b3cd48bfde47189b62 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 29 Oct 2019 19:47:01 +0100 Subject: [PATCH 04/34] Update raqote due to bugfix --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac076d7dca6..3a4c0f1d349 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4187,8 +4187,8 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" -version = "0.7.4-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#2a801bca7253e053767ef5ea11b0ee77c52617c9" +version = "0.7.5-alpha.0" +source = "git+https://github.com/jrmuizel/raqote#053e0d75cf21d93543b6213016569025c4333b97" dependencies = [ "euclid", "font-kit", @@ -5527,9 +5527,9 @@ checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b" [[package]] name = "sw-composite" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71bd71d7772bdbb7e5fbe37f767c5b2506bd23e72c12186a63f78c0980f64e9b" +checksum = "26278512d0de15b0578a75cb45f98ab39dfee7877151e5cb0d08e4e29898f7d5" [[package]] name = "swapper" From b8b33788b654d76e26aa7acefb7e85e46f60896b Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Thu, 31 Oct 2019 19:11:56 +0100 Subject: [PATCH 05/34] Handle empty paths in PathBuilder::get_current_point() The case of calling get_current_point() on empty paths has not been handled and caused panics. --- components/canvas/azure_backend.rs | 4 ++-- components/canvas/canvas_data.rs | 8 +++++--- components/canvas/raqote_backend.rs | 20 ++++++++------------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/components/canvas/azure_backend.rs b/components/canvas/azure_backend.rs index fa48d869c40..9b9d94c5052 100644 --- a/components/canvas/azure_backend.rs +++ b/components/canvas/azure_backend.rs @@ -189,9 +189,9 @@ impl GenericPathBuilder for azure_hl::PathBuilder { anticlockwise, ); } - fn get_current_point(&mut self) -> Point2D { + fn get_current_point(&mut self) -> Option> { let AzPoint { x, y } = azure_hl::PathBuilder::get_current_point(self); - Point2D::new(x as f32, y as f32) + Some(Point2D::new(x as f32, y as f32)) } fn line_to(&mut self, point: Point2D) { azure_hl::PathBuilder::line_to(self, point as Point2D); diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 29dd1743b46..12bc87f84e1 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -108,7 +108,7 @@ pub trait GenericPathBuilder { end_angle: f32, anticlockwise: bool, ); - fn get_current_point(&mut self) -> Point2D; + fn get_current_point(&mut self) -> Option>; fn line_to(&mut self, point: Point2D); fn move_to(&mut self, point: Point2D); fn quadratic_curve_to(&mut self, control_point: &Point2D, end_point: &Point2D); @@ -205,8 +205,10 @@ impl<'a> PathBuilderRef<'a> { Some(i) => i, None => return None, }; - let current_point = self.builder.get_current_point(); - Some(inverse.transform_point(Point2D::new(current_point.x, current_point.y))) + match self.builder.get_current_point() { + Some(point) => Some(inverse.transform_point(Point2D::new(point.x, point.y))), + None => None, + } } } diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 438689bae03..cda608ae0ec 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -564,22 +564,18 @@ impl GenericPathBuilder for PathBuilder { } } - fn get_current_point(&mut self) -> Point2D { + fn get_current_point(&mut self) -> Option> { let path = self.finish(); self.0 = Some(path.as_raqote().clone().into()); - for op in path.as_raqote().ops.iter().rev() { - match op { - PathOp::MoveTo(point) | PathOp::LineTo(point) => { - return Point2D::new(point.x, point.y) - }, - PathOp::CubicTo(_, _, point) => return Point2D::new(point.x, point.y), - PathOp::QuadTo(_, point) => return Point2D::new(point.x, point.y), - PathOp::Close => {}, - }; - } - panic!("dead end"); + path.as_raqote().ops.iter().last().and_then(|op| match op { + PathOp::MoveTo(point) | PathOp::LineTo(point) => Some(Point2D::new(point.x, point.y)), + PathOp::CubicTo(_, _, point) => Some(Point2D::new(point.x, point.y)), + PathOp::QuadTo(_, point) => Some(Point2D::new(point.x, point.y)), + PathOp::Close => None, + }) } + fn line_to(&mut self, point: Point2D) { self.0.as_mut().unwrap().line_to(point.x, point.y); } From 2aa16fc7318a47b620714856035bb0cb401f56a6 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 5 Nov 2019 19:46:05 +0100 Subject: [PATCH 06/34] Update raqote --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 3a4c0f1d349..97d76463d31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4188,7 +4188,7 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" version = "0.7.5-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#053e0d75cf21d93543b6213016569025c4333b97" +source = "git+https://github.com/jrmuizel/raqote#6a68a5486e605fc84ad9461f29a230119f4caff4" dependencies = [ "euclid", "font-kit", From 77a8bc4a1d9868bf2cbb1f57293dca8b72ea4268 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 5 Nov 2019 20:08:09 +0100 Subject: [PATCH 07/34] Fix conversion of image data slice --- components/canvas/raqote_backend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index cda608ae0ec..b75b464cc7d 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -288,7 +288,7 @@ impl GenericDrawTarget for raqote::DrawTarget { data: unsafe { std::slice::from_raw_parts( v.as_ptr() as *const u32, - v.len() * std::mem::size_of::(), + v.len() / std::mem::size_of::(), ) }, }; From 5c6a12a1160daff040ca1cab4e3c7693b4a718e8 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 5 Nov 2019 20:09:32 +0100 Subject: [PATCH 08/34] Create raqote::SolidSource with premultiplied color SolidSource expects a premultiplied color. --- components/canvas/raqote_backend.rs | 60 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index b75b464cc7d..2d4e0bf72b4 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -84,12 +84,12 @@ impl Backend for RaqoteBackend { impl<'a> CanvasPaintState<'a> { pub fn new(_antialias: AntialiasMode) -> CanvasPaintState<'a> { - let solid_src = raqote::SolidSource { - r: 0, - g: 0, - b: 0, - a: 255, - }; + let solid_src = raqote::SolidSource::from_unpremultiplied_argb( + 255, + 0, + 0, + 0, + ); CanvasPaintState { draw_options: DrawOptions::Raqote(raqote::DrawOptions::new()), fill_style: Pattern::Raqote(raqote::Source::Solid(solid_src)), @@ -99,12 +99,12 @@ impl<'a> CanvasPaintState<'a> { shadow_offset_x: 0.0, shadow_offset_y: 0.0, shadow_blur: 0.0, - shadow_color: Color::Raqote(raqote::SolidSource { - r: 0, - g: 0, - b: 0, - a: 0, - }), + shadow_color: Color::Raqote(raqote::SolidSource::from_unpremultiplied_argb( + 0, + 0, + 0, + 0, + )), } } } @@ -221,12 +221,12 @@ impl GenericDrawTarget for raqote::DrawTarget { raqote::DrawTarget::fill( self, &pb.finish(), - &raqote::Source::Solid(raqote::SolidSource { - r: 0, - g: 0, - b: 0, - a: 0, - }), + &raqote::Source::Solid(raqote::SolidSource::from_unpremultiplied_argb( + 0, + 0, + 0, + 0, + )), &options, ); } @@ -652,12 +652,12 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { use canvas_traits::canvas::FillOrStrokeStyle::*; match self { - Color(rgba) => Some(raqote::Source::Solid(raqote::SolidSource { - r: rgba.red, - g: rgba.green, - b: rgba.blue, - a: rgba.alpha, - })), + Color(rgba) => Some(raqote::Source::Solid(raqote::SolidSource::from_unpremultiplied_argb( + rgba.alpha, + rgba.red, + rgba.green, + rgba.blue, + ))), LinearGradient(style) => { let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); let gradient = raqote::Gradient { stops }; @@ -715,12 +715,12 @@ impl ToRaqoteStyle for RGBA { type Target = raqote::SolidSource; fn to_raqote_style(self) -> Self::Target { - raqote::SolidSource { - r: self.red, - g: self.green, - b: self.blue, - a: self.alpha, - } + raqote::SolidSource::from_unpremultiplied_argb( + self.alpha, + self.red, + self.green, + self.blue, + ) } } From 5151309ee801509622f06aecee5b1b63d735b418 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Thu, 7 Nov 2019 18:59:46 +0100 Subject: [PATCH 09/34] Update raqote due to bugfix --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97d76463d31..be949553b52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4188,7 +4188,7 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" version = "0.7.5-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#6a68a5486e605fc84ad9461f29a230119f4caff4" +source = "git+https://github.com/jrmuizel/raqote#34d9d0b1ff37d25c69ab92faaba6b9c529cc0a9c" dependencies = [ "euclid", "font-kit", @@ -5527,9 +5527,9 @@ checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b" [[package]] name = "sw-composite" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26278512d0de15b0578a75cb45f98ab39dfee7877151e5cb0d08e4e29898f7d5" +checksum = "50a36f1738c7e57fec506df8c94719b2210816ab9de4d3dadeb9efb6bc71f1d2" [[package]] name = "swapper" From 55256df0ba186e8147236282c3bc0faab9ff0a10 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Thu, 7 Nov 2019 19:51:32 +0100 Subject: [PATCH 10/34] Use tolerance > 0 in Path::contains_point() --- components/canvas/raqote_backend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 2d4e0bf72b4..5d3f2e74cb1 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -191,7 +191,7 @@ impl Path { self.as_raqote() .clone() .transform(path_transform) - .contains_point(0., x as f32, y as f32) + .contains_point(0.1, x as f32, y as f32) } pub fn copy_to_builder(&self) -> Box { From 208728194036403e51d5b6bc8faf67bfb9f6208b Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 9 Nov 2019 16:26:59 +0100 Subject: [PATCH 11/34] Update raqote due to bugfix for arc point in path --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be949553b52..e4f499cc961 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4187,8 +4187,8 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" -version = "0.7.5-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#34d9d0b1ff37d25c69ab92faaba6b9c529cc0a9c" +version = "0.7.6-alpha.0" +source = "git+https://github.com/jrmuizel/raqote#e73192b2f7996c0cdb0fa1e80e1636a12dba2cbf" dependencies = [ "euclid", "font-kit", From bd1e30fa6624e05a6c883955d70663f4e87ee6c3 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sun, 10 Nov 2019 23:13:34 +0100 Subject: [PATCH 12/34] Update raqote --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e4f499cc961..f645cda67f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4188,7 +4188,7 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" version = "0.7.6-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#e73192b2f7996c0cdb0fa1e80e1636a12dba2cbf" +source = "git+https://github.com/jrmuizel/raqote#83ca41945e4b70738e7075541b4338edceb5fc69" dependencies = [ "euclid", "font-kit", From 9f58ae4b07753299a63f2ff4830a99082f1cd89e Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Fri, 15 Nov 2019 20:38:22 +0100 Subject: [PATCH 13/34] Update raqote: linear gradient fix --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index f645cda67f1..2821194e943 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4188,7 +4188,7 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" version = "0.7.6-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#83ca41945e4b70738e7075541b4338edceb5fc69" +source = "git+https://github.com/jrmuizel/raqote#e8339ff1e6c3d21873a6b892d2d3af9283062d34" dependencies = [ "euclid", "font-kit", From d87e5d831ba2032c65173f5a7a92316d539a36b0 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 16 Nov 2019 19:02:49 +0100 Subject: [PATCH 14/34] Add check to handle zerosize linear gradients --- components/canvas/raqote_backend.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 5d3f2e74cb1..c958695acf1 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -660,9 +660,14 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { ))), LinearGradient(style) => { let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); - let gradient = raqote::Gradient { stops }; + let mut gradient = raqote::Gradient { stops }; let start = Point2D::new(style.x0 as f32, style.y0 as f32); let end = Point2D::new(style.x1 as f32, style.y1 as f32); + if start == end { + // TODO + // hack to make Pattern::is_zero_size_gradient() return true + gradient.stops.clear(); + } Some(raqote::Source::new_linear_gradient( gradient, start, From 16f06f24c5d4d9dc0c8797f0661575db346a85fc Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 16 Nov 2019 19:17:42 +0100 Subject: [PATCH 15/34] Add check for handling equal radial gradients --- components/canvas/raqote_backend.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index c958695acf1..ec0061a24bf 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -677,9 +677,16 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { }, RadialGradient(style) => { let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); - let gradient = raqote::Gradient { stops }; + let mut gradient = raqote::Gradient { stops }; let center1 = Point2D::new(style.x0 as f32, style.y0 as f32); let center2 = Point2D::new(style.x1 as f32, style.y1 as f32); + let equal_centers = center1 == center2; + let equal_radius = style.r0 == style.r1; + if equal_centers && equal_radius { + // TODO + // hack to make Pattern::is_zero_size_gradient() return true + gradient.stops.clear(); + } Some(raqote::Source::new_two_circle_radial_gradient( gradient, center1, From a473f5024535d75c9213a1f43cd2f6a4976d8a1d Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 19 Nov 2019 14:21:52 +0100 Subject: [PATCH 16/34] Respect FilterMode when drawing images --- components/canvas/raqote_backend.rs | 39 +++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index ec0061a24bf..edcd0dcea4c 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -278,29 +278,39 @@ impl GenericDrawTarget for raqote::DrawTarget { surface: SourceSurface, dest: Rect, source: Rect, - _filter: Filter, + filter: Filter, draw_options: &DrawOptions, ) { - let v = surface.as_raqote(); + let surface_data = surface.as_raqote(); let image = raqote::Image { width: source.size.width as i32, height: source.size.height as i32, data: unsafe { std::slice::from_raw_parts( - v.as_ptr() as *const u32, - v.len() / std::mem::size_of::(), + surface_data.as_ptr() as *const u32, + surface_data.len() / std::mem::size_of::(), ) }, }; - raqote::DrawTarget::draw_image_with_size_at( - self, - dest.size.width as f32, - dest.size.height as f32, + let mut pb = raqote::PathBuilder::new(); + pb.rect( dest.origin.x as f32, dest.origin.y as f32, - &image, - draw_options.as_raqote(), + dest.size.width as f32, + dest.size.height as f32, ); + let source = raqote::Source::Image( + image, + raqote::ExtendMode::Pad, + filter.to_raqote(), + raqote::Transform::create_translation(-dest.origin.x as f32, -dest.origin.y as f32) + .post_scale( + image.width as f32 / dest.size.width as f32, + image.height as f32 / dest.size.height as f32, + ), + ); + + self.fill(&pb.finish(), &source, draw_options.as_raqote()); } fn draw_surface_with_shadow( &self, @@ -446,6 +456,15 @@ impl GenericDrawTarget for raqote::DrawTarget { } } +impl Filter { + fn to_raqote(&self) -> raqote::FilterMode { + match self { + Filter::Linear => raqote::FilterMode::Bilinear, + Filter::Point => raqote::FilterMode::Nearest, + } + } +} + struct PathBuilder(Option); impl PathBuilder { From 4d4e68ca6b97deb5699b00a1d40f462de160ca74 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 19 Nov 2019 15:18:23 +0100 Subject: [PATCH 17/34] Respect direction when drawing arcs --- components/canvas/raqote_backend.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index edcd0dcea4c..4bc4eae49fb 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -479,9 +479,12 @@ impl GenericPathBuilder for PathBuilder { origin: Point2D, radius: f32, start_angle: f32, - end_angle: f32, - _anticlockwise: bool, + mut end_angle: f32, + anticlockwise: bool, ) { + if anticlockwise { + end_angle = -end_angle; + } self.0 .as_mut() .unwrap() From 47ee2729ecaab55dfa9a3379feda435ab48692d6 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 30 Nov 2019 21:21:07 +0100 Subject: [PATCH 18/34] Make fill() draw uncovered pixels as (0,0,0,0) for certain composition ops --- components/canvas/raqote_backend.rs | 49 ++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 4bc4eae49fb..a7cf3bd1023 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -310,7 +310,12 @@ impl GenericDrawTarget for raqote::DrawTarget { ), ); - self.fill(&pb.finish(), &source, draw_options.as_raqote()); + GenericDrawTarget::fill( + self, + &Path::Raqote(pb.finish()), + Pattern::Raqote(source), + draw_options, + ); } fn draw_surface_with_shadow( &self, @@ -324,11 +329,36 @@ impl GenericDrawTarget for raqote::DrawTarget { warn!("no support for drawing shadows"); } fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions) { - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); + match draw_options.as_raqote().blend_mode { + raqote::BlendMode::Src => { + self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); + self.fill( + path.as_raqote(), + pattern.as_raqote(), + draw_options.as_raqote(), + ); + }, + raqote::BlendMode::DstIn | + raqote::BlendMode::DstAtop | + raqote::BlendMode::SrcIn | + raqote::BlendMode::SrcOut => { + self.push_layer(1.); + self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); + self.fill( + path.as_raqote(), + pattern.as_raqote(), + draw_options.as_raqote(), + ); + self.pop_layer(); + }, + _ => { + self.fill( + path.as_raqote(), + pattern.as_raqote(), + draw_options.as_raqote(), + ); + }, + } } fn fill_rect( &mut self, @@ -349,7 +379,12 @@ impl GenericDrawTarget for raqote::DrawTarget { raqote::DrawOptions::new() }; - raqote::DrawTarget::fill(self, &pb.finish(), pattern.as_raqote(), &draw_options); + GenericDrawTarget::fill( + self, + &Path::Raqote(pb.finish()), + pattern, + &DrawOptions::Raqote(draw_options), + ); } fn get_format(&self) -> SurfaceFormat { SurfaceFormat::Raqote(()) From 1597b956b89d12d3fd43b36ee9969e2be2e15342 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sun, 1 Dec 2019 17:31:26 +0100 Subject: [PATCH 19/34] Update raqote to have blend modes working on layers --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2821194e943..bc3b1250b16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4187,8 +4187,8 @@ checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" [[package]] name = "raqote" -version = "0.7.6-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#e8339ff1e6c3d21873a6b892d2d3af9283062d34" +version = "0.7.7-alpha.0" +source = "git+https://github.com/jrmuizel/raqote#79162ec845a1f7ac221fbe5d50cde3f6630bf335" dependencies = [ "euclid", "font-kit", From da9b4c33cd68929437e1443f6ab23027b3f26ce0 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Mon, 2 Dec 2019 07:54:45 +0100 Subject: [PATCH 20/34] Make fill() handle all composition operations --- components/canvas/raqote_backend.rs | 35 +++++------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index a7cf3bd1023..317703154c3 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -329,36 +329,11 @@ impl GenericDrawTarget for raqote::DrawTarget { warn!("no support for drawing shadows"); } fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions) { - match draw_options.as_raqote().blend_mode { - raqote::BlendMode::Src => { - self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); - }, - raqote::BlendMode::DstIn | - raqote::BlendMode::DstAtop | - raqote::BlendMode::SrcIn | - raqote::BlendMode::SrcOut => { - self.push_layer(1.); - self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); - self.pop_layer(); - }, - _ => { - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); - }, - } + let mut options = draw_options.as_raqote().clone(); + self.push_layer_with_blend(1., options.blend_mode); + options.blend_mode = raqote::BlendMode::SrcOver; + self.fill(path.as_raqote(), pattern.as_raqote(), &options); + self.pop_layer(); } fn fill_rect( &mut self, From 02e33254167116284fb89501921919f165536650 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Mon, 2 Dec 2019 14:32:17 +0100 Subject: [PATCH 21/34] Make arc() use `anticlockwise` argument --- components/canvas/raqote_backend.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 317703154c3..ba1b5f99700 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -492,9 +492,10 @@ impl GenericPathBuilder for PathBuilder { mut end_angle: f32, anticlockwise: bool, ) { - if anticlockwise { + if (anticlockwise && end_angle > 0.) || (!anticlockwise && end_angle < 0.) { end_angle = -end_angle; } + self.0 .as_mut() .unwrap() From a02daef7b29a796a736e97d39f9c389b2d4bd70a Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Mon, 2 Dec 2019 14:33:37 +0100 Subject: [PATCH 22/34] Make arc() wrap angles mod 2pi --- components/canvas/raqote_backend.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index ba1b5f99700..b940277a0f3 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -488,10 +488,17 @@ impl GenericPathBuilder for PathBuilder { &mut self, origin: Point2D, radius: f32, - start_angle: f32, + mut start_angle: f32, mut end_angle: f32, anticlockwise: bool, ) { + if (!anticlockwise && start_angle > end_angle + 2. * PI) || + (anticlockwise && end_angle > start_angle + 2. * PI) + { + start_angle = start_angle % (2. * PI); + end_angle = end_angle % (2. * PI); + } + if (anticlockwise && end_angle > 0.) || (!anticlockwise && end_angle < 0.) { end_angle = -end_angle; } From 04e9523e5f9cdc19b7116dae4f3ad6110f1e65a6 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 3 Dec 2019 18:30:39 +0100 Subject: [PATCH 23/34] Use push_layer_with_blend() only when necessary push_layer_with_blend() comes at a performance cost, so we only use it on blend modes that require it. --- components/canvas/raqote_backend.rs | 41 +++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index b940277a0f3..01eaa15632c 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -329,11 +329,42 @@ impl GenericDrawTarget for raqote::DrawTarget { warn!("no support for drawing shadows"); } fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions) { - let mut options = draw_options.as_raqote().clone(); - self.push_layer_with_blend(1., options.blend_mode); - options.blend_mode = raqote::BlendMode::SrcOver; - self.fill(path.as_raqote(), pattern.as_raqote(), &options); - self.pop_layer(); + match draw_options.as_raqote().blend_mode { + raqote::BlendMode::Src => { + self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); + self.fill( + path.as_raqote(), + pattern.as_raqote(), + draw_options.as_raqote(), + ); + }, + raqote::BlendMode::SrcAtop | + raqote::BlendMode::DstOut | + raqote::BlendMode::Add | + raqote::BlendMode::Xor | + raqote::BlendMode::DstOver | + raqote::BlendMode::SrcOver => { + self.fill( + path.as_raqote(), + pattern.as_raqote(), + draw_options.as_raqote(), + ); + }, + raqote::BlendMode::SrcIn | + raqote::BlendMode::SrcOut | + raqote::BlendMode::DstIn | + raqote::BlendMode::DstAtop => { + let mut options = draw_options.as_raqote().clone(); + self.push_layer_with_blend(1., options.blend_mode); + options.blend_mode = raqote::BlendMode::SrcOver; + self.fill(path.as_raqote(), pattern.as_raqote(), &options); + self.pop_layer(); + }, + _ => warn!( + "unrecognized blend mode: {:?}", + draw_options.as_raqote().blend_mode + ), + } } fn fill_rect( &mut self, From 1cdcbb25fa990cbeb773798ea6c872df4d2bcda6 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 7 Dec 2019 17:07:21 +0100 Subject: [PATCH 24/34] Handle overlapping gradient stops for linear gradients From `addColorStop(offset, color)`s spec: If multiple stops are added at the same offset on a gradient, they must be placed in the order added, with the first one closest to the start of the gradient, and each subsequent one infinitesimally further along towards the end point (in effect causing all but the first and last stop added at each point to be ignored) https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlapu --- components/canvas/raqote_backend.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 01eaa15632c..7905af3b2a1 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -243,15 +243,19 @@ impl GenericDrawTarget for raqote::DrawTarget { dt.get_data_mut().copy_from_slice(s); raqote::DrawTarget::copy_surface(self, &dt, source.to_box2d(), destination); } + // TODO(pylbrecht) + // unused code? fn create_gradient_stops( &self, gradient_stops: Vec, _extend_mode: ExtendMode, ) -> GradientStops { - let stops = gradient_stops + let mut stops = gradient_stops .into_iter() .map(|item| item.as_raqote().clone()) - .collect(); + .collect::>(); + // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); GradientStops::Raqote(stops) } fn create_path_builder(&self) -> Box { @@ -730,7 +734,10 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { rgba.blue, ))), LinearGradient(style) => { - let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); + let mut stops: Vec = + style.stops.into_iter().map(|s| s.to_raqote()).collect(); + // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); let mut gradient = raqote::Gradient { stops }; let start = Point2D::new(style.x0 as f32, style.y0 as f32); let end = Point2D::new(style.x1 as f32, style.y1 as f32); From 25d036f05c9ff4c7538c58c9064c12d3a9c269f1 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 7 Dec 2019 21:47:00 +0100 Subject: [PATCH 25/34] Set images' ExtendMode based on available information --- components/canvas/raqote_backend.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 7905af3b2a1..4276c0aa187 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -776,6 +776,11 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { }, Surface(ref surface) => { let data = &surface.surface_data[..]; + let extend = if surface.repeat_x || surface.repeat_y { + raqote::ExtendMode::Repeat + } else { + raqote::ExtendMode::Pad + }; Some(raqote::Source::Image( raqote::Image { data: unsafe { @@ -784,7 +789,7 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { width: surface.surface_size.width as i32, height: surface.surface_size.height as i32, }, - raqote::ExtendMode::Repeat, // TODO: repeat-x, repeat-y ? + extend, raqote::FilterMode::Bilinear, raqote::Transform::identity(), )) From 1aecf40922337f7bd514ecd00b2ce9c43f3877d7 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 10 Dec 2019 14:58:21 +0100 Subject: [PATCH 26/34] Implement "repeat-x" and "repeat-y" for images --- components/canvas/canvas_data.rs | 10 ++- components/canvas/raqote_backend.rs | 115 ++++++++++++++++------------ 2 files changed, 77 insertions(+), 48 deletions(-) diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 12bc87f84e1..c843ab19454 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -358,7 +358,15 @@ pub enum Pattern<'a> { #[cfg(feature = "canvas2d-azure")] Azure(azure::azure_hl::Pattern, PhantomData<&'a ()>), #[cfg(feature = "canvas2d-raqote")] - Raqote(raqote::Source<'a>), + Raqote(raqote::Source<'a>, Option), +} + +#[derive(Clone)] +pub enum Repetition { + Repeat, + RepeatX, + RepeatY, + NoRepeat, } pub enum DrawSurfaceOptions { diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 4276c0aa187..73f7762609e 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -4,7 +4,7 @@ use crate::canvas_data::{ Backend, CanvasPaintState, Color, CompositionOp, DrawOptions, ExtendMode, Filter, - GenericDrawTarget, GenericPathBuilder, GradientStop, GradientStops, Path, Pattern, + GenericDrawTarget, GenericPathBuilder, GradientStop, GradientStops, Path, Pattern, Repetition, SourceSurface, StrokeOptions, SurfaceFormat, }; use crate::canvas_paint_thread::AntialiasMode; @@ -28,9 +28,23 @@ impl Backend for RaqoteBackend { fn size_from_pattern(&self, rect: &Rect, pattern: &Pattern) -> Option> { match pattern { - Pattern::Raqote(raqote::Source::Image(image, extend, ..)) => match extend { - raqote::ExtendMode::Repeat => Some(rect.size), - _ => Some(Size2D::new(image.width as f32, image.height as f32)), + Pattern::Raqote(raqote::Source::Image(image, ..), repetition) => { + if let Some(repeat) = repetition { + match repeat { + Repetition::RepeatX => { + Some(Size2D::new(rect.size.width as f32, image.height as f32)) + }, + Repetition::RepeatY => { + Some(Size2D::new(image.width as f32, rect.size.height as f32)) + }, + Repetition::Repeat => Some(rect.size), + Repetition::NoRepeat => { + Some(Size2D::new(image.width as f32, image.height as f32)) + }, + } + } else { + None + } }, _ => None, } @@ -46,8 +60,8 @@ impl Backend for RaqoteBackend { state: &mut CanvasPaintState<'a>, _drawtarget: &dyn GenericDrawTarget, ) { - if let Some(source) = style.to_raqote_source() { - state.fill_style = Pattern::Raqote(source); + if let Some(pattern) = style.to_raqote_source() { + state.fill_style = pattern; } } @@ -58,7 +72,7 @@ impl Backend for RaqoteBackend { _drawtarget: &dyn GenericDrawTarget, ) { if let Some(pattern) = style.to_raqote_source() { - state.stroke_style = Pattern::Raqote(pattern) + state.stroke_style = pattern; } } @@ -92,8 +106,8 @@ impl<'a> CanvasPaintState<'a> { ); CanvasPaintState { draw_options: DrawOptions::Raqote(raqote::DrawOptions::new()), - fill_style: Pattern::Raqote(raqote::Source::Solid(solid_src)), - stroke_style: Pattern::Raqote(raqote::Source::Solid(solid_src)), + fill_style: Pattern::Raqote(raqote::Source::Solid(solid_src), None), + stroke_style: Pattern::Raqote(raqote::Source::Solid(solid_src), None), stroke_opts: StrokeOptions::Raqote(Default::default(), PhantomData), transform: Transform2D::identity(), shadow_offset_x: 0.0, @@ -112,10 +126,10 @@ impl<'a> CanvasPaintState<'a> { impl Pattern<'_> { pub fn is_zero_size_gradient(&self) -> bool { match self { - Pattern::Raqote(p) => { + Pattern::Raqote(source, _) => { use raqote::Source::*; - match p { + match source { LinearGradient(g, ..) | RadialGradient(g, ..) | TwoCircleRadialGradient(g, ..) => g.stops.is_empty(), @@ -124,9 +138,14 @@ impl Pattern<'_> { }, } } - pub fn as_raqote(&self) -> &raqote::Source { + pub fn source(&self) -> &raqote::Source { match self { - Pattern::Raqote(p) => p, + Pattern::Raqote(source, _) => source, + } + } + pub fn repetition(&self) -> &Option { + match self { + Pattern::Raqote(_, repetition) => repetition, } } } @@ -317,7 +336,7 @@ impl GenericDrawTarget for raqote::DrawTarget { GenericDrawTarget::fill( self, &Path::Raqote(pb.finish()), - Pattern::Raqote(source), + Pattern::Raqote(source, None), draw_options, ); } @@ -336,11 +355,7 @@ impl GenericDrawTarget for raqote::DrawTarget { match draw_options.as_raqote().blend_mode { raqote::BlendMode::Src => { self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); + self.fill(path.as_raqote(), pattern.source(), draw_options.as_raqote()); }, raqote::BlendMode::SrcAtop | raqote::BlendMode::DstOut | @@ -348,11 +363,7 @@ impl GenericDrawTarget for raqote::DrawTarget { raqote::BlendMode::Xor | raqote::BlendMode::DstOver | raqote::BlendMode::SrcOver => { - self.fill( - path.as_raqote(), - pattern.as_raqote(), - draw_options.as_raqote(), - ); + self.fill(path.as_raqote(), pattern.source(), draw_options.as_raqote()); }, raqote::BlendMode::SrcIn | raqote::BlendMode::SrcOut | @@ -361,7 +372,7 @@ impl GenericDrawTarget for raqote::DrawTarget { let mut options = draw_options.as_raqote().clone(); self.push_layer_with_blend(1., options.blend_mode); options.blend_mode = raqote::BlendMode::SrcOver; - self.fill(path.as_raqote(), pattern.as_raqote(), &options); + self.fill(path.as_raqote(), pattern.source(), &options); self.pop_layer(); }, _ => warn!( @@ -426,7 +437,7 @@ impl GenericDrawTarget for raqote::DrawTarget { ) { self.stroke( path.as_raqote(), - pattern.as_raqote(), + pattern.source(), stroke_options.as_raqote(), draw_options.as_raqote(), ); @@ -451,7 +462,7 @@ impl GenericDrawTarget for raqote::DrawTarget { self.stroke( &pb.finish(), - pattern.as_raqote(), + pattern.source(), &stroke_options, draw_options.as_raqote(), ); @@ -473,7 +484,7 @@ impl GenericDrawTarget for raqote::DrawTarget { self.stroke( &pb.finish(), - pattern.as_raqote(), + pattern.source(), stroke_options.as_raqote(), draw_options.as_raqote(), ); @@ -701,7 +712,7 @@ impl ToRaqoteStyle for LineCapStyle { } pub trait ToRaqoteSource<'a> { - fn to_raqote_source(self) -> Option>; + fn to_raqote_source(self) -> Option>; } pub trait ToRaqoteGradientStop { @@ -723,16 +734,15 @@ impl ToRaqoteGradientStop for CanvasGradientStop { impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { #[allow(unsafe_code)] - fn to_raqote_source(self) -> Option> { + fn to_raqote_source(self) -> Option> { use canvas_traits::canvas::FillOrStrokeStyle::*; match self { - Color(rgba) => Some(raqote::Source::Solid(raqote::SolidSource::from_unpremultiplied_argb( - rgba.alpha, - rgba.red, - rgba.green, - rgba.blue, - ))), + Color(rgba) => Some(Pattern::Raqote(raqote::Source::Solid( + raqote::SolidSource::from_unpremultiplied_argb( + rgba.alpha, rgba.red, rgba.green, rgba.blue, + ), + ), None)), LinearGradient(style) => { let mut stops: Vec = style.stops.into_iter().map(|s| s.to_raqote()).collect(); @@ -746,12 +756,12 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { // hack to make Pattern::is_zero_size_gradient() return true gradient.stops.clear(); } - Some(raqote::Source::new_linear_gradient( + Some(Pattern::Raqote(raqote::Source::new_linear_gradient( gradient, start, end, raqote::Spread::Pad, - )) + ), None)) }, RadialGradient(style) => { let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); @@ -765,34 +775,45 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { // hack to make Pattern::is_zero_size_gradient() return true gradient.stops.clear(); } - Some(raqote::Source::new_two_circle_radial_gradient( + Some(Pattern::Raqote(raqote::Source::new_two_circle_radial_gradient( gradient, center1, style.r0 as f32, center2, style.r1 as f32, raqote::Spread::Pad, - )) + ), None)) }, - Surface(ref surface) => { - let data = &surface.surface_data[..]; - let extend = if surface.repeat_x || surface.repeat_y { + Surface(ref style) => { + let repetition = if style.repeat_x && style.repeat_y { + Repetition::Repeat + } else if style.repeat_x { + Repetition::RepeatX + } else if style.repeat_y { + Repetition::RepeatY + } else { + Repetition::NoRepeat + }; + + let extend = if style.repeat_x || style.repeat_y { raqote::ExtendMode::Repeat } else { raqote::ExtendMode::Pad }; - Some(raqote::Source::Image( + + let data = &style.surface_data[..]; + Some(Pattern::Raqote(raqote::Source::Image( raqote::Image { data: unsafe { std::slice::from_raw_parts(data.as_ptr() as *const u32, data.len() / 4) }, - width: surface.surface_size.width as i32, - height: surface.surface_size.height as i32, + width: style.surface_size.width as i32, + height: style.surface_size.height as i32, }, extend, raqote::FilterMode::Bilinear, raqote::Transform::identity(), - )) + ), Some(repetition))) }, } } From a50aef6f00d3ba1cb45a0eb5d0c7fafbbe7bb1fb Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Fri, 13 Dec 2019 22:15:19 +0100 Subject: [PATCH 27/34] Add a layer to store Pattern related information Some information of `canvas_data::Pattern` was lost by converting it to `raqote::Source` due to the fact that Raqote did not store this information (e.g. linear gradient's start/end points). We introduce another layer to keep this information for later use (like in `is_zero_size_gradient()`). --- components/canvas/canvas_data.rs | 10 +- components/canvas/raqote_backend.rs | 414 +++++++++++++++++----------- 2 files changed, 249 insertions(+), 175 deletions(-) diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index c843ab19454..ab30dbe9741 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -358,15 +358,7 @@ pub enum Pattern<'a> { #[cfg(feature = "canvas2d-azure")] Azure(azure::azure_hl::Pattern, PhantomData<&'a ()>), #[cfg(feature = "canvas2d-raqote")] - Raqote(raqote::Source<'a>, Option), -} - -#[derive(Clone)] -pub enum Repetition { - Repeat, - RepeatX, - RepeatY, - NoRepeat, + Raqote(crate::raqote_backend::Pattern<'a>), } pub enum DrawSurfaceOptions { diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 73f7762609e..ca93944e4f7 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -2,10 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +use crate::canvas_data; use crate::canvas_data::{ Backend, CanvasPaintState, Color, CompositionOp, DrawOptions, ExtendMode, Filter, - GenericDrawTarget, GenericPathBuilder, GradientStop, GradientStops, Path, Pattern, Repetition, - SourceSurface, StrokeOptions, SurfaceFormat, + GenericDrawTarget, GenericPathBuilder, GradientStop, GradientStops, Path, SourceSurface, + StrokeOptions, SurfaceFormat, }; use crate::canvas_paint_thread::AntialiasMode; use canvas_traits::canvas::*; @@ -26,25 +27,26 @@ impl Backend for RaqoteBackend { color.as_raqote().a != 0 } - fn size_from_pattern(&self, rect: &Rect, pattern: &Pattern) -> Option> { + fn size_from_pattern( + &self, + rect: &Rect, + pattern: &canvas_data::Pattern, + ) -> Option> { match pattern { - Pattern::Raqote(raqote::Source::Image(image, ..), repetition) => { - if let Some(repeat) = repetition { - match repeat { - Repetition::RepeatX => { - Some(Size2D::new(rect.size.width as f32, image.height as f32)) - }, - Repetition::RepeatY => { - Some(Size2D::new(image.width as f32, rect.size.height as f32)) - }, - Repetition::Repeat => Some(rect.size), - Repetition::NoRepeat => { - Some(Size2D::new(image.width as f32, image.height as f32)) - }, - } - } else { - None - } + canvas_data::Pattern::Raqote(Pattern::Surface(pattern)) => match pattern.repeat { + Repetition::RepeatX => Some(Size2D::new( + rect.size.width as f32, + pattern.image.height as f32, + )), + Repetition::RepeatY => Some(Size2D::new( + pattern.image.width as f32, + rect.size.height as f32, + )), + Repetition::Repeat => Some(rect.size), + Repetition::NoRepeat => Some(Size2D::new( + pattern.image.width as f32, + pattern.image.height as f32, + )), }, _ => None, } @@ -60,8 +62,8 @@ impl Backend for RaqoteBackend { state: &mut CanvasPaintState<'a>, _drawtarget: &dyn GenericDrawTarget, ) { - if let Some(pattern) = style.to_raqote_source() { - state.fill_style = pattern; + if let Some(pattern) = style.to_raqote_pattern() { + state.fill_style = canvas_data::Pattern::Raqote(pattern); } } @@ -71,8 +73,8 @@ impl Backend for RaqoteBackend { state: &mut CanvasPaintState<'a>, _drawtarget: &dyn GenericDrawTarget, ) { - if let Some(pattern) = style.to_raqote_source() { - state.stroke_style = pattern; + if let Some(pattern) = style.to_raqote_pattern() { + state.stroke_style = canvas_data::Pattern::Raqote(pattern); } } @@ -98,54 +100,162 @@ impl Backend for RaqoteBackend { impl<'a> CanvasPaintState<'a> { pub fn new(_antialias: AntialiasMode) -> CanvasPaintState<'a> { - let solid_src = raqote::SolidSource::from_unpremultiplied_argb( - 255, - 0, - 0, - 0, - ); + let pattern = Pattern::Color(255, 0, 0, 0); CanvasPaintState { draw_options: DrawOptions::Raqote(raqote::DrawOptions::new()), - fill_style: Pattern::Raqote(raqote::Source::Solid(solid_src), None), - stroke_style: Pattern::Raqote(raqote::Source::Solid(solid_src), None), + fill_style: canvas_data::Pattern::Raqote(pattern.clone()), + stroke_style: canvas_data::Pattern::Raqote(pattern), stroke_opts: StrokeOptions::Raqote(Default::default(), PhantomData), transform: Transform2D::identity(), shadow_offset_x: 0.0, shadow_offset_y: 0.0, shadow_blur: 0.0, - shadow_color: Color::Raqote(raqote::SolidSource::from_unpremultiplied_argb( - 0, - 0, - 0, - 0, - )), + shadow_color: Color::Raqote(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)), } } } -impl Pattern<'_> { - pub fn is_zero_size_gradient(&self) -> bool { - match self { - Pattern::Raqote(source, _) => { - use raqote::Source::*; +#[derive(Clone)] +pub enum Pattern<'a> { + // argb + Color(u8, u8, u8, u8), + LinearGradient(LinearGradientPattern), + RadialGradient(RadialGradientPattern), + Surface(SurfacePattern<'a>), +} - match source { - LinearGradient(g, ..) | - RadialGradient(g, ..) | - TwoCircleRadialGradient(g, ..) => g.stops.is_empty(), - _ => false, - } +#[derive(Clone)] +pub struct LinearGradientPattern { + gradient: raqote::Gradient, + start: Point2D, + end: Point2D, +} + +impl LinearGradientPattern { + fn new(start: Point2D, end: Point2D, stops: Vec) -> Self { + LinearGradientPattern { + gradient: raqote::Gradient { stops: stops }, + start: start, + end: end, + } + } +} + +#[derive(Clone)] +pub struct RadialGradientPattern { + gradient: raqote::Gradient, + center1: Point2D, + radius1: f32, + center2: Point2D, + radius2: f32, +} + +impl RadialGradientPattern { + fn new( + center1: Point2D, + radius1: f32, + center2: Point2D, + radius2: f32, + stops: Vec, + ) -> Self { + RadialGradientPattern { + gradient: raqote::Gradient { stops: stops }, + center1: center1, + radius1: radius1, + center2: center2, + radius2: radius2, + } + } +} + +#[derive(Clone)] +pub struct SurfacePattern<'a> { + image: raqote::Image<'a>, + filter: raqote::FilterMode, + extend: raqote::ExtendMode, + repeat: Repetition, +} + +impl<'a> SurfacePattern<'a> { + fn new(image: raqote::Image<'a>, filter: raqote::FilterMode, repeat: Repetition) -> Self { + let extend = match repeat { + Repetition::NoRepeat => raqote::ExtendMode::Pad, + Repetition::RepeatX | Repetition::RepeatY | Repetition::Repeat => { + raqote::ExtendMode::Repeat + }, + }; + SurfacePattern { + image: image, + filter: filter, + extend: extend, + repeat: repeat, + } + } +} + +#[derive(Clone)] +pub enum Repetition { + Repeat, + RepeatX, + RepeatY, + NoRepeat, +} + +impl Repetition { + fn from_xy(repeat_x: bool, repeat_y: bool) -> Self { + if repeat_x && repeat_y { + Repetition::Repeat + } else if repeat_x { + Repetition::RepeatX + } else if repeat_y { + Repetition::RepeatY + } else { + Repetition::NoRepeat + } + } +} + +impl canvas_data::Pattern<'_> { + pub fn source(&self) -> raqote::Source { + match self { + canvas_data::Pattern::Raqote(pattern) => match pattern { + Pattern::Color(a, r, g, b) => raqote::Source::Solid( + raqote::SolidSource::from_unpremultiplied_argb(*a, *r, *g, *b), + ), + Pattern::LinearGradient(pattern) => raqote::Source::new_linear_gradient( + pattern.gradient.clone(), + pattern.start, + pattern.end, + raqote::Spread::Pad, + ), + Pattern::RadialGradient(pattern) => raqote::Source::new_two_circle_radial_gradient( + pattern.gradient.clone(), + pattern.center1, + pattern.radius1, + pattern.center2, + pattern.radius2, + raqote::Spread::Pad, + ), + Pattern::Surface(pattern) => raqote::Source::Image( + pattern.image, + pattern.extend, + pattern.filter, + Transform2D::identity(), + ), }, } } - pub fn source(&self) -> &raqote::Source { + pub fn is_zero_size_gradient(&self) -> bool { match self { - Pattern::Raqote(source, _) => source, - } - } - pub fn repetition(&self) -> &Option { - match self { - Pattern::Raqote(_, repetition) => repetition, + canvas_data::Pattern::Raqote(pattern) => match pattern { + Pattern::RadialGradient(pattern) => { + let centers_equal = pattern.center1 == pattern.center2; + let radii_equal = pattern.radius1 == pattern.radius2; + centers_equal && radii_equal + }, + Pattern::LinearGradient(pattern) => pattern.start == pattern.end, + Pattern::Color(..) | Pattern::Surface(..) => false, + }, } } } @@ -226,6 +336,16 @@ impl Path { } } +fn create_gradient_stops(gradient_stops: Vec) -> GradientStops { + let mut stops = gradient_stops + .into_iter() + .map(|item| item.as_raqote().clone()) + .collect::>(); + // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + GradientStops::Raqote(stops) +} + impl GenericDrawTarget for raqote::DrawTarget { fn clear_rect(&mut self, rect: &Rect) { let mut pb = raqote::PathBuilder::new(); @@ -237,16 +357,12 @@ impl GenericDrawTarget for raqote::DrawTarget { ); let mut options = raqote::DrawOptions::new(); options.blend_mode = raqote::BlendMode::Clear; - raqote::DrawTarget::fill( + let pattern = Pattern::Color(0, 0, 0, 0); + GenericDrawTarget::fill( self, - &pb.finish(), - &raqote::Source::Solid(raqote::SolidSource::from_unpremultiplied_argb( - 0, - 0, - 0, - 0, - )), - &options, + &Path::Raqote(pb.finish()), + canvas_data::Pattern::Raqote(pattern), + &DrawOptions::Raqote(options), ); } #[allow(unsafe_code)] @@ -262,21 +378,14 @@ impl GenericDrawTarget for raqote::DrawTarget { dt.get_data_mut().copy_from_slice(s); raqote::DrawTarget::copy_surface(self, &dt, source.to_box2d(), destination); } - // TODO(pylbrecht) - // unused code? fn create_gradient_stops( &self, gradient_stops: Vec, _extend_mode: ExtendMode, ) -> GradientStops { - let mut stops = gradient_stops - .into_iter() - .map(|item| item.as_raqote().clone()) - .collect::>(); - // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap - stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); - GradientStops::Raqote(stops) + create_gradient_stops(gradient_stops) } + fn create_path_builder(&self) -> Box { Box::new(PathBuilder::new()) } @@ -322,21 +431,15 @@ impl GenericDrawTarget for raqote::DrawTarget { dest.size.width as f32, dest.size.height as f32, ); - let source = raqote::Source::Image( + let pattern = Pattern::Surface(SurfacePattern::new( image, - raqote::ExtendMode::Pad, filter.to_raqote(), - raqote::Transform::create_translation(-dest.origin.x as f32, -dest.origin.y as f32) - .post_scale( - image.width as f32 / dest.size.width as f32, - image.height as f32 / dest.size.height as f32, - ), - ); - + Repetition::NoRepeat, + )); GenericDrawTarget::fill( self, &Path::Raqote(pb.finish()), - Pattern::Raqote(source, None), + canvas_data::Pattern::Raqote(pattern), draw_options, ); } @@ -351,11 +454,15 @@ impl GenericDrawTarget for raqote::DrawTarget { ) { warn!("no support for drawing shadows"); } - fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions) { + fn fill(&mut self, path: &Path, pattern: canvas_data::Pattern, draw_options: &DrawOptions) { match draw_options.as_raqote().blend_mode { raqote::BlendMode::Src => { self.clear(raqote::SolidSource::from_unpremultiplied_argb(0, 0, 0, 0)); - self.fill(path.as_raqote(), pattern.source(), draw_options.as_raqote()); + self.fill( + path.as_raqote(), + &pattern.source(), + draw_options.as_raqote(), + ); }, raqote::BlendMode::SrcAtop | raqote::BlendMode::DstOut | @@ -363,7 +470,11 @@ impl GenericDrawTarget for raqote::DrawTarget { raqote::BlendMode::Xor | raqote::BlendMode::DstOver | raqote::BlendMode::SrcOver => { - self.fill(path.as_raqote(), pattern.source(), draw_options.as_raqote()); + self.fill( + path.as_raqote(), + &pattern.source(), + draw_options.as_raqote(), + ); }, raqote::BlendMode::SrcIn | raqote::BlendMode::SrcOut | @@ -372,7 +483,7 @@ impl GenericDrawTarget for raqote::DrawTarget { let mut options = draw_options.as_raqote().clone(); self.push_layer_with_blend(1., options.blend_mode); options.blend_mode = raqote::BlendMode::SrcOver; - self.fill(path.as_raqote(), pattern.source(), &options); + self.fill(path.as_raqote(), &pattern.source(), &options); self.pop_layer(); }, _ => warn!( @@ -384,7 +495,7 @@ impl GenericDrawTarget for raqote::DrawTarget { fn fill_rect( &mut self, rect: &Rect, - pattern: Pattern, + pattern: canvas_data::Pattern, draw_options: Option<&DrawOptions>, ) { let mut pb = raqote::PathBuilder::new(); @@ -431,13 +542,13 @@ impl GenericDrawTarget for raqote::DrawTarget { fn stroke( &mut self, path: &Path, - pattern: Pattern, + pattern: canvas_data::Pattern, stroke_options: &StrokeOptions, draw_options: &DrawOptions, ) { self.stroke( path.as_raqote(), - pattern.source(), + &pattern.source(), stroke_options.as_raqote(), draw_options.as_raqote(), ); @@ -446,7 +557,7 @@ impl GenericDrawTarget for raqote::DrawTarget { &mut self, start: Point2D, end: Point2D, - pattern: Pattern, + pattern: canvas_data::Pattern, stroke_options: &StrokeOptions, draw_options: &DrawOptions, ) { @@ -462,7 +573,7 @@ impl GenericDrawTarget for raqote::DrawTarget { self.stroke( &pb.finish(), - pattern.source(), + &pattern.source(), &stroke_options, draw_options.as_raqote(), ); @@ -470,7 +581,7 @@ impl GenericDrawTarget for raqote::DrawTarget { fn stroke_rect( &mut self, rect: &Rect, - pattern: Pattern, + pattern: canvas_data::Pattern, stroke_options: &StrokeOptions, draw_options: &DrawOptions, ) { @@ -484,7 +595,7 @@ impl GenericDrawTarget for raqote::DrawTarget { self.stroke( &pb.finish(), - pattern.source(), + &pattern.source(), stroke_options.as_raqote(), draw_options.as_raqote(), ); @@ -711,8 +822,8 @@ impl ToRaqoteStyle for LineCapStyle { } } -pub trait ToRaqoteSource<'a> { - fn to_raqote_source(self) -> Option>; +pub trait ToRaqotePattern<'a> { + fn to_raqote_pattern(self) -> Option>; } pub trait ToRaqoteGradientStop { @@ -732,88 +843,64 @@ impl ToRaqoteGradientStop for CanvasGradientStop { } } -impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle { +impl<'a> ToRaqotePattern<'_> for FillOrStrokeStyle { #[allow(unsafe_code)] - fn to_raqote_source(self) -> Option> { + fn to_raqote_pattern(self) -> Option> { use canvas_traits::canvas::FillOrStrokeStyle::*; match self { - Color(rgba) => Some(Pattern::Raqote(raqote::Source::Solid( - raqote::SolidSource::from_unpremultiplied_argb( - rgba.alpha, rgba.red, rgba.green, rgba.blue, - ), - ), None)), + Color(color) => Some(Pattern::Color( + color.alpha, + color.red, + color.green, + color.blue, + )), LinearGradient(style) => { - let mut stops: Vec = - style.stops.into_iter().map(|s| s.to_raqote()).collect(); - // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap - stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); - let mut gradient = raqote::Gradient { stops }; let start = Point2D::new(style.x0 as f32, style.y0 as f32); let end = Point2D::new(style.x1 as f32, style.y1 as f32); - if start == end { - // TODO - // hack to make Pattern::is_zero_size_gradient() return true - gradient.stops.clear(); - } - Some(Pattern::Raqote(raqote::Source::new_linear_gradient( - gradient, - start, - end, - raqote::Spread::Pad, - ), None)) + let mut stops = style + .stops + .iter() + .map(|s| s.to_raqote()) + .collect::>(); + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + Some(Pattern::LinearGradient(LinearGradientPattern::new( + start, end, stops, + ))) }, RadialGradient(style) => { - let stops = style.stops.into_iter().map(|s| s.to_raqote()).collect(); - let mut gradient = raqote::Gradient { stops }; let center1 = Point2D::new(style.x0 as f32, style.y0 as f32); let center2 = Point2D::new(style.x1 as f32, style.y1 as f32); - let equal_centers = center1 == center2; - let equal_radius = style.r0 == style.r1; - if equal_centers && equal_radius { - // TODO - // hack to make Pattern::is_zero_size_gradient() return true - gradient.stops.clear(); - } - Some(Pattern::Raqote(raqote::Source::new_two_circle_radial_gradient( - gradient, + let mut stops = style + .stops + .iter() + .map(|s| s.to_raqote()) + .collect::>(); + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + Some(Pattern::RadialGradient(RadialGradientPattern::new( center1, style.r0 as f32, center2, style.r1 as f32, - raqote::Spread::Pad, - ), None)) + stops, + ))) }, Surface(ref style) => { - let repetition = if style.repeat_x && style.repeat_y { - Repetition::Repeat - } else if style.repeat_x { - Repetition::RepeatX - } else if style.repeat_y { - Repetition::RepeatY - } else { - Repetition::NoRepeat - }; - - let extend = if style.repeat_x || style.repeat_y { - raqote::ExtendMode::Repeat - } else { - raqote::ExtendMode::Pad - }; - + let repeat = Repetition::from_xy(style.repeat_x, style.repeat_y); let data = &style.surface_data[..]; - Some(Pattern::Raqote(raqote::Source::Image( - raqote::Image { - data: unsafe { - std::slice::from_raw_parts(data.as_ptr() as *const u32, data.len() / 4) - }, - width: style.surface_size.width as i32, - height: style.surface_size.height as i32, + + let image = raqote::Image { + width: style.surface_size.width as i32, + height: style.surface_size.height as i32, + data: unsafe { + std::slice::from_raw_parts(data.as_ptr() as *const u32, data.len() / 4) }, - extend, - raqote::FilterMode::Bilinear, - raqote::Transform::identity(), - ), Some(repetition))) + }; + Some(Pattern::Surface(SurfacePattern::new( + image, + raqote::FilterMode::Nearest, + repeat, + ))) }, } } @@ -831,12 +918,7 @@ impl ToRaqoteStyle for RGBA { type Target = raqote::SolidSource; fn to_raqote_style(self) -> Self::Target { - raqote::SolidSource::from_unpremultiplied_argb( - self.alpha, - self.red, - self.green, - self.blue, - ) + raqote::SolidSource::from_unpremultiplied_argb(self.alpha, self.red, self.green, self.blue) } } From ada7986fef26eb4925c505d500549d11b8764ea4 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 14 Dec 2019 11:42:15 +0100 Subject: [PATCH 28/34] Handle `BlendMode::Clear` in `GenericDrawTarget::fill()` --- components/canvas/raqote_backend.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index ca93944e4f7..cd9b523552e 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -464,6 +464,7 @@ impl GenericDrawTarget for raqote::DrawTarget { draw_options.as_raqote(), ); }, + raqote::BlendMode::Clear | raqote::BlendMode::SrcAtop | raqote::BlendMode::DstOut | raqote::BlendMode::Add | From 9a2370a3a8ff4db7b3baf725f83797904be16547 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 14 Dec 2019 11:54:39 +0100 Subject: [PATCH 29/34] Consider empty gradients in `is_zero_size_gradient()` --- components/canvas/raqote_backend.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index cd9b523552e..10d7fd47a4f 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -251,9 +251,11 @@ impl canvas_data::Pattern<'_> { Pattern::RadialGradient(pattern) => { let centers_equal = pattern.center1 == pattern.center2; let radii_equal = pattern.radius1 == pattern.radius2; - centers_equal && radii_equal + (centers_equal && radii_equal) || pattern.gradient.stops.is_empty() + }, + Pattern::LinearGradient(pattern) => { + (pattern.start == pattern.end) || pattern.gradient.stops.is_empty() }, - Pattern::LinearGradient(pattern) => pattern.start == pattern.end, Pattern::Color(..) | Pattern::Surface(..) => false, }, } From b99b92d4c24919be935d75b5972d55db334b083a Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 14 Dec 2019 13:30:02 +0100 Subject: [PATCH 30/34] Update wpt test expectation for image-smoothing --- .../2dcontext/image-smoothing/imagesmoothing.html.ini | 11 ----------- .../image-smoothing/image.smoothing.html.ini | 10 ---------- .../image-smoothing/image.smoothing.worker.js.ini | 10 ---------- 3 files changed, 31 deletions(-) delete mode 100644 tests/wpt/metadata/2dcontext/image-smoothing/imagesmoothing.html.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.html.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.worker.js.ini diff --git a/tests/wpt/metadata/2dcontext/image-smoothing/imagesmoothing.html.ini b/tests/wpt/metadata/2dcontext/image-smoothing/imagesmoothing.html.ini deleted file mode 100644 index 189d034a87c..00000000000 --- a/tests/wpt/metadata/2dcontext/image-smoothing/imagesmoothing.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[imagesmoothing.html] - type: testharness - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fillRect and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fill() and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern().] - expected: FAIL - diff --git a/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.html.ini b/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.html.ini deleted file mode 100644 index ea4369032a5..00000000000 --- a/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.html.ini +++ /dev/null @@ -1,10 +0,0 @@ -[image.smoothing.html] - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fillRect and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fill() and createPattern().] - expected: FAIL - diff --git a/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.worker.js.ini b/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.worker.js.ini deleted file mode 100644 index d5390f1498b..00000000000 --- a/tests/wpt/metadata/offscreen-canvas/image-smoothing/image.smoothing.worker.js.ini +++ /dev/null @@ -1,10 +0,0 @@ -[image.smoothing.worker.html] - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fillRect and createPattern().] - expected: FAIL - - [Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fill() and createPattern().] - expected: FAIL - From 7c8c230d9379684df121ca930ad5c52778df4a2f Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 14 Dec 2019 17:16:42 +0100 Subject: [PATCH 31/34] Add transform to Pattern::Surface to properly draw images --- components/canvas/raqote_backend.rs | 38 ++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 10d7fd47a4f..b2849219e29 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -124,6 +124,17 @@ pub enum Pattern<'a> { Surface(SurfacePattern<'a>), } +impl<'a> Pattern<'a> { + fn set_transform(&mut self, transform: Transform2D) { + match self { + Pattern::Surface(pattern) => pattern.set_transform(transform), + Pattern::LinearGradient(..) | Pattern::RadialGradient(..) | Pattern::Color(..) => { + warn!("transform not supported") + }, + } + } +} + #[derive(Clone)] pub struct LinearGradientPattern { gradient: raqote::Gradient, @@ -174,6 +185,7 @@ pub struct SurfacePattern<'a> { filter: raqote::FilterMode, extend: raqote::ExtendMode, repeat: Repetition, + transform: Transform2D, } impl<'a> SurfacePattern<'a> { @@ -189,8 +201,12 @@ impl<'a> SurfacePattern<'a> { filter: filter, extend: extend, repeat: repeat, + transform: Transform2D::identity(), } } + fn set_transform(&mut self, transform: Transform2D) { + self.transform = transform; + } } #[derive(Clone)] @@ -240,7 +256,7 @@ impl canvas_data::Pattern<'_> { pattern.image, pattern.extend, pattern.filter, - Transform2D::identity(), + pattern.transform, ), }, } @@ -426,6 +442,20 @@ impl GenericDrawTarget for raqote::DrawTarget { ) }, }; + + let mut pattern = Pattern::Surface(SurfacePattern::new( + image, + filter.to_raqote(), + Repetition::NoRepeat, + )); + let transform = + raqote::Transform::create_translation(-dest.origin.x as f32, -dest.origin.y as f32) + .post_scale( + image.width as f32 / dest.size.width as f32, + image.height as f32 / dest.size.height as f32, + ); + pattern.set_transform(transform); + let mut pb = raqote::PathBuilder::new(); pb.rect( dest.origin.x as f32, @@ -433,11 +463,7 @@ impl GenericDrawTarget for raqote::DrawTarget { dest.size.width as f32, dest.size.height as f32, ); - let pattern = Pattern::Surface(SurfacePattern::new( - image, - filter.to_raqote(), - Repetition::NoRepeat, - )); + GenericDrawTarget::fill( self, &Path::Raqote(pb.finish()), From e0547855df7d5ff1d49dd1b5fce65b10391f74f1 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sun, 15 Dec 2019 10:01:04 +0100 Subject: [PATCH 32/34] Remove duplication for creating gradient stops --- components/canvas/raqote_backend.rs | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index b2849219e29..ec8f0f8e4a8 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -354,14 +354,14 @@ impl Path { } } -fn create_gradient_stops(gradient_stops: Vec) -> GradientStops { +fn create_gradient_stops(gradient_stops: Vec) -> Vec { let mut stops = gradient_stops .into_iter() - .map(|item| item.as_raqote().clone()) + .map(|item| item.to_raqote()) .collect::>(); // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); - GradientStops::Raqote(stops) + stops } impl GenericDrawTarget for raqote::DrawTarget { @@ -396,12 +396,22 @@ impl GenericDrawTarget for raqote::DrawTarget { dt.get_data_mut().copy_from_slice(s); raqote::DrawTarget::copy_surface(self, &dt, source.to_box2d(), destination); } + // TODO(pylbrecht) + // Somehow a duplicate of `create_gradient_stops()` with different types. + // It feels cumbersome to convert GradientStop back and forth just to use + // `create_gradient_stops()`, so I'll leave this here for now. fn create_gradient_stops( &self, gradient_stops: Vec, _extend_mode: ExtendMode, ) -> GradientStops { - create_gradient_stops(gradient_stops) + let mut stops = gradient_stops + .into_iter() + .map(|item| item.as_raqote().clone()) + .collect::>(); + // https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap + stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + GradientStops::Raqote(stops) } fn create_path_builder(&self) -> Box { @@ -887,12 +897,7 @@ impl<'a> ToRaqotePattern<'_> for FillOrStrokeStyle { LinearGradient(style) => { let start = Point2D::new(style.x0 as f32, style.y0 as f32); let end = Point2D::new(style.x1 as f32, style.y1 as f32); - let mut stops = style - .stops - .iter() - .map(|s| s.to_raqote()) - .collect::>(); - stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + let stops = create_gradient_stops(style.stops); Some(Pattern::LinearGradient(LinearGradientPattern::new( start, end, stops, ))) @@ -900,12 +905,7 @@ impl<'a> ToRaqotePattern<'_> for FillOrStrokeStyle { RadialGradient(style) => { let center1 = Point2D::new(style.x0 as f32, style.y0 as f32); let center2 = Point2D::new(style.x1 as f32, style.y1 as f32); - let mut stops = style - .stops - .iter() - .map(|s| s.to_raqote()) - .collect::>(); - stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap()); + let stops = create_gradient_stops(style.stops); Some(Pattern::RadialGradient(RadialGradientPattern::new( center1, style.r0 as f32, From cdd4dc41b3d5ddfe3442e5078ee7c58c6f19bfeb Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Tue, 17 Dec 2019 19:53:56 +0100 Subject: [PATCH 33/34] Update wpt test expectations --- .../drawimage_canvas.html.ini | 9 + .../2d.fillRect.shadow.html.ini | 4 + .../2d.gradient.radial.cone.behind.html.ini | 4 + .../2d.gradient.radial.cone.beside.html.ini | 4 + .../2d.gradient.radial.cone.shape2.html.ini | 4 + .../2d.gradient.radial.inside3.html.ini | 4 + .../2d.gradient.radial.outside2.html.ini | 4 + .../2d.gradient.radial.touch1.html.ini | 4 + .../2d.gradient.radial.touch2.html.ini | 4 + .../2d.gradient.radial.touch3.html.ini | 4 + .../2d.pattern.animated.gif.html.ini | 4 + .../line-styles/2d.line.cap.closed.html.ini | 4 + .../line-styles/2d.line.cap.round.html.ini | 4 + .../path-objects/2d.path.arc.scale.2.html.ini | 4 + .../2d.path.arc.selfintersect.1.html.ini | 4 + .../2d.path.arc.selfintersect.2.html.ini | 4 + .../path-objects/2d.path.arc.shape.3.html.ini | 4 + .../path-objects/2d.path.arc.shape.4.html.ini | 4 + .../2d.path.arc.twopie.1.html.ini | 4 + .../2d.path.arc.twopie.3.html.ini | 4 + .../2d.path.arcTo.ensuresubpath.2.html.ini | 4 + .../path-objects/2d.path.arcTo.scale.html.ini | 4 + .../2d.path.arcTo.shape.curve1.html.ini | 5 - .../2d.path.arcTo.transformation.html.ini | 4 + .../2d.path.closePath.nextpoint.html.ini | 4 + ....quadraticCurveTo.ensuresubpath.2.html.ini | 4 + .../path-objects/2d.path.rect.end.1.html.ini | 4 + .../shadows/2d.shadow.alpha.2.html.ini | 4 + .../shadows/2d.shadow.alpha.3.html.ini | 4 + .../shadows/2d.shadow.alpha.4.html.ini | 4 + .../shadows/2d.shadow.alpha.5.html.ini | 4 + .../shadows/2d.shadow.canvas.alpha.html.ini | 4 + .../shadows/2d.shadow.canvas.basic.html.ini | 4 + .../2d.shadow.canvas.transparent.2.html.ini | 4 + .../shadows/2d.shadow.clip.1.html.ini | 4 + .../shadows/2d.shadow.clip.2.html.ini | 4 + .../shadows/2d.shadow.clip.3.html.ini | 4 + .../shadows/2d.shadow.composite.1.html.ini | 4 + .../shadows/2d.shadow.composite.2.html.ini | 4 + .../shadows/2d.shadow.gradient.alpha.html.ini | 4 + .../shadows/2d.shadow.gradient.basic.html.ini | 4 + .../2d.shadow.gradient.transparent.2.html.ini | 4 + .../shadows/2d.shadow.image.alpha.html.ini | 4 + .../shadows/2d.shadow.image.basic.html.ini | 4 + .../shadows/2d.shadow.image.scale.html.ini | 4 + .../2d.shadow.image.transparent.2.html.ini | 4 + .../2d.shadow.offset.negativeX.html.ini | 4 + .../2d.shadow.offset.negativeY.html.ini | 4 + .../2d.shadow.offset.positiveX.html.ini | 4 + .../2d.shadow.offset.positiveY.html.ini | 4 + .../shadows/2d.shadow.outside.html.ini | 4 + .../shadows/2d.shadow.pattern.alpha.html.ini | 4 + .../shadows/2d.shadow.pattern.basic.html.ini | 4 + .../2d.shadow.pattern.transparent.2.html.ini | 4 + .../shadows/2d.shadow.transform.1.html.ini | 4 + .../shadows/2d.shadow.transform.2.html.ini | 4 + .../shadows/canvas_shadows_001.htm.ini | 4 + .../shadowBlur_gaussian_tolerance.1.html.ini | 10 + .../2d.transformation.scale.large.html.ini | 4 + .../transformations/transform_a.html.ini | 2 + .../css/css-paint-api/overdraw.https.html.ini | 2 + .../perspective-interpolation.html.ini | 376 +++++++++++++++++- ...on-from-ua-to-blocking-stylesheet.html.ini | 2 +- .../cssom-view/MediaQueryListEvent.html.ini | 4 + .../offsetTopLeft-border-box.html.ini | 7 + .../encoding/single-byte-decoder.html.ini | 1 + .../fetch/content-type/response.window.js.ini | 11 +- .../nosniff/parsing-nosniff.window.js.ini | 3 - ...mbedded-credentials.tentative.sub.html.ini | 8 +- .../traverse_the_history_1.html.ini | 4 + ...ml.ini => traverse_the_history_5.html.ini} | 2 +- ...creating_browsing_context_test_01.html.ini | 4 - .../tables/table-width-150percent.html.ini | 2 + .../form-double-submit-2.html.ini | 2 +- .../form-double-submit.html.ini | 2 +- .../form-submission-algorithm.html.ini | 3 - .../htmlanchorelement_noopener.html.ini | 6 +- .../parsing/DOMContentLoaded-defer.html.ini | 4 - .../promise-rejection-events.html.ini | 4 + .../2d.fillRect.shadow.html.ini | 4 + .../2d.fillRect.shadow.worker.js.ini | 4 + .../2d.gradient.radial.cone.behind.html.ini | 4 + ....gradient.radial.cone.behind.worker.js.ini | 4 + .../2d.gradient.radial.cone.beside.html.ini | 4 + ....gradient.radial.cone.beside.worker.js.ini | 4 + .../2d.gradient.radial.cone.shape2.html.ini | 4 + ....gradient.radial.cone.shape2.worker.js.ini | 4 + .../2d.gradient.radial.inside3.html.ini | 4 + .../2d.gradient.radial.inside3.worker.js.ini | 4 + .../2d.gradient.radial.outside2.html.ini | 4 + .../2d.gradient.radial.outside2.worker.js.ini | 4 + .../2d.gradient.radial.touch1.html.ini | 4 + .../2d.gradient.radial.touch1.worker.js.ini | 4 + .../2d.gradient.radial.touch2.html.ini | 4 + .../2d.gradient.radial.touch2.worker.js.ini | 4 + .../2d.gradient.radial.touch3.html.ini | 4 + .../2d.gradient.radial.touch3.worker.js.ini | 4 + .../line-styles/2d.line.cap.closed.html.ini | 4 + .../2d.line.cap.closed.worker.js.ini | 4 + .../line-styles/2d.line.cap.round.html.ini | 4 + .../2d.line.cap.round.worker.js.ini | 4 + .../path-objects/2d.path.arc.scale.2.html.ini | 4 + .../2d.path.arc.scale.2.worker.js.ini | 4 + .../2d.path.arc.selfintersect.1.html.ini | 4 + .../2d.path.arc.selfintersect.1.worker.js.ini | 4 + .../2d.path.arc.selfintersect.2.html.ini | 4 + .../2d.path.arc.selfintersect.2.worker.js.ini | 4 + .../path-objects/2d.path.arc.shape.3.html.ini | 4 + .../2d.path.arc.shape.3.worker.js.ini | 4 + .../path-objects/2d.path.arc.shape.4.html.ini | 4 + .../2d.path.arc.shape.4.worker.js.ini | 4 + .../2d.path.arc.twopie.1.html.ini | 4 + .../2d.path.arc.twopie.1.worker.js.ini | 4 + .../2d.path.arc.twopie.3.html.ini | 4 + .../2d.path.arc.twopie.3.worker.js.ini | 4 + .../2d.path.arcTo.ensuresubpath.2.html.ini | 4 + ...d.path.arcTo.ensuresubpath.2.worker.js.ini | 4 + .../path-objects/2d.path.arcTo.scale.html.ini | 4 + .../2d.path.arcTo.scale.worker.js.ini | 4 + .../2d.path.arcTo.shape.curve1.html.ini | 4 - .../2d.path.arcTo.shape.curve1.worker.js.ini | 4 - .../2d.path.arcTo.transformation.html.ini | 4 + ...2d.path.arcTo.transformation.worker.js.ini | 4 + .../2d.path.closePath.nextpoint.html.ini | 4 + .../2d.path.closePath.nextpoint.worker.js.ini | 4 + ....quadraticCurveTo.ensuresubpath.2.html.ini | 4 + ...raticCurveTo.ensuresubpath.2.worker.js.ini | 4 + .../path-objects/2d.path.rect.end.1.html.ini | 4 + .../2d.path.rect.end.1.worker.js.ini | 4 + .../shadows/2d.shadow.alpha.2.html.ini | 4 + .../shadows/2d.shadow.alpha.2.worker.js.ini | 4 + .../shadows/2d.shadow.alpha.3.html.ini | 4 + .../shadows/2d.shadow.alpha.3.worker.js.ini | 4 + .../shadows/2d.shadow.alpha.4.html.ini | 4 + .../shadows/2d.shadow.alpha.4.worker.js.ini | 4 + .../shadows/2d.shadow.alpha.5.html.ini | 4 + .../shadows/2d.shadow.alpha.5.worker.js.ini | 4 + .../shadows/2d.shadow.canvas.alpha.html.ini | 4 + .../2d.shadow.canvas.alpha.worker.js.ini | 4 + .../shadows/2d.shadow.canvas.basic.html.ini | 4 + .../2d.shadow.canvas.basic.worker.js.ini | 4 + .../2d.shadow.canvas.transparent.2.html.ini | 4 + ....shadow.canvas.transparent.2.worker.js.ini | 4 + .../shadows/2d.shadow.clip.1.html.ini | 4 + .../shadows/2d.shadow.clip.1.worker.js.ini | 4 + .../shadows/2d.shadow.clip.2.html.ini | 4 + .../shadows/2d.shadow.clip.2.worker.js.ini | 4 + .../shadows/2d.shadow.clip.3.html.ini | 4 + .../shadows/2d.shadow.clip.3.worker.js.ini | 4 + .../shadows/2d.shadow.composite.1.html.ini | 4 + .../2d.shadow.composite.1.worker.js.ini | 4 + .../shadows/2d.shadow.composite.2.html.ini | 4 + .../2d.shadow.composite.2.worker.js.ini | 4 + .../shadows/2d.shadow.gradient.alpha.html.ini | 4 + .../2d.shadow.gradient.alpha.worker.js.ini | 4 + .../shadows/2d.shadow.gradient.basic.html.ini | 4 + .../2d.shadow.gradient.basic.worker.js.ini | 4 + .../2d.shadow.gradient.transparent.2.html.ini | 4 + ...hadow.gradient.transparent.2.worker.js.ini | 4 + .../2d.shadow.offset.negativeX.html.ini | 4 + .../2d.shadow.offset.negativeX.worker.js.ini | 4 + .../2d.shadow.offset.negativeY.html.ini | 4 + .../2d.shadow.offset.negativeY.worker.js.ini | 4 + .../2d.shadow.offset.positiveX.html.ini | 4 + .../2d.shadow.offset.positiveX.worker.js.ini | 4 + .../2d.shadow.offset.positiveY.html.ini | 4 + .../2d.shadow.offset.positiveY.worker.js.ini | 4 + .../shadows/2d.shadow.outside.html.ini | 4 + .../shadows/2d.shadow.outside.worker.js.ini | 4 + .../shadows/2d.shadow.transform.1.html.ini | 4 + .../2d.shadow.transform.1.worker.js.ini | 4 + .../shadows/2d.shadow.transform.2.html.ini | 4 + .../2d.shadow.transform.2.worker.js.ini | 4 + .../the-offscreen-canvas/size.large.html.ini | 2 - .../size.large.worker.js.ini | 2 - .../2d.transformation.scale.large.html.ini | 4 + ...d.transformation.scale.large.worker.js.ini | 4 + .../webtiming-resolution.any.js.ini | 3 - .../crossorigin-sandwich-TAO.sub.html.ini | 1 + .../realtimeanalyser-fft-scaling.html.ini | 1 + .../sub-sample-buffer-stitching.html.ini | 6 + .../webmessaging/without-ports/017.html.ini | 5 - ...sion_features_deviceSupport.https.html.ini | 1 + .../invalid-characteristic-name.html.ini | 2 + .../css/canvas_linear_gradient_a.html.ini | 2 + .../css/canvas_radial_gradient_a.html.ini | 2 + .../rendering/rgb-format-support.html.ini | 5 + 187 files changed, 1049 insertions(+), 64 deletions(-) create mode 100644 tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html.ini create mode 100644 tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.closed.html.ini create mode 100644 tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.round.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.scale.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.4.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.ensuresubpath.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.scale.html.ini delete mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.shape.curve1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.transformation.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.closePath.nextpoint.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/path-objects/2d.path.rect.end.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.4.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.5.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.alpha.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.basic.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.transparent.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.3.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.alpha.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.basic.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.alpha.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.basic.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.scale.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.transparent.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeX.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeY.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveX.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveY.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.outside.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.alpha.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.basic.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.transparent.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.2.html.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/canvas_shadows_001.htm.ini create mode 100644 tests/wpt/metadata/2dcontext/shadows/shadowBlur_gaussian_tolerance.1.html.ini create mode 100644 tests/wpt/metadata/2dcontext/transformations/2d.transformation.scale.large.html.ini create mode 100644 tests/wpt/metadata/2dcontext/transformations/transform_a.html.ini create mode 100644 tests/wpt/metadata/css/css-paint-api/overdraw.https.html.ini create mode 100644 tests/wpt/metadata/css/cssom-view/MediaQueryListEvent.html.ini create mode 100644 tests/wpt/metadata/css/cssom-view/offsetTopLeft-border-box.html.ini create mode 100644 tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini rename tests/wpt/metadata/html/browsers/history/the-history-interface/{traverse_the_history_3.html.ini => traverse_the_history_5.html.ini} (71%) delete mode 100644 tests/wpt/metadata/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html.ini create mode 100644 tests/wpt/metadata/html/rendering/non-replaced-elements/tables/table-width-150percent.html.ini delete mode 100644 tests/wpt/metadata/html/syntax/parsing/DOMContentLoaded-defer.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.behind.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.beside.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.inside3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.touch3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/line-styles/2d.line.cap.closed.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/line-styles/2d.line.cap.closed.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/line-styles/2d.line.cap.round.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/line-styles/2d.line.cap.round.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.scale.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.scale.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.selfintersect.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.selfintersect.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.selfintersect.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.selfintersect.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.shape.3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.shape.3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.shape.4.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.shape.4.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.twopie.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.twopie.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.twopie.3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arc.twopie.3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.ensuresubpath.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.ensuresubpath.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.scale.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.scale.worker.js.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.shape.curve1.html.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.shape.curve1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.transformation.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.arcTo.transformation.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.closePath.nextpoint.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.closePath.nextpoint.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.rect.end.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/path-objects/2d.path.rect.end.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.4.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.4.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.5.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.alpha.5.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.alpha.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.alpha.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.basic.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.basic.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.transparent.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.canvas.transparent.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.3.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.clip.3.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.composite.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.composite.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.composite.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.composite.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.alpha.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.alpha.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.basic.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.basic.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.transparent.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.gradient.transparent.2.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.negativeX.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.negativeX.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.negativeY.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.negativeY.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.positiveX.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.positiveX.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.positiveY.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.offset.positiveY.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.outside.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.outside.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.transform.1.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.transform.1.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.transform.2.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/shadows/2d.shadow.transform.2.worker.js.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/the-offscreen-canvas/size.large.html.ini delete mode 100644 tests/wpt/metadata/offscreen-canvas/the-offscreen-canvas/size.large.worker.js.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/transformations/2d.transformation.scale.large.html.ini create mode 100644 tests/wpt/metadata/offscreen-canvas/transformations/2d.transformation.scale.large.worker.js.ini delete mode 100644 tests/wpt/metadata/webmessaging/without-ports/017.html.ini create mode 100644 tests/wpt/mozilla/meta/bluetooth/getCharacteristic/invalid-characteristic-name.html.ini create mode 100644 tests/wpt/mozilla/meta/css/canvas_linear_gradient_a.html.ini create mode 100644 tests/wpt/mozilla/meta/css/canvas_radial_gradient_a.html.ini create mode 100644 tests/wpt/webgl/meta/conformance2/rendering/rgb-format-support.html.ini diff --git a/tests/wpt/metadata/2dcontext/drawing-images-to-the-canvas/drawimage_canvas.html.ini b/tests/wpt/metadata/2dcontext/drawing-images-to-the-canvas/drawimage_canvas.html.ini index 379f7c20b67..ff46db987b4 100644 --- a/tests/wpt/metadata/2dcontext/drawing-images-to-the-canvas/drawimage_canvas.html.ini +++ b/tests/wpt/metadata/2dcontext/drawing-images-to-the-canvas/drawimage_canvas.html.ini @@ -24,3 +24,12 @@ [Test scenario 12: sx = -20, sy = -20, sw = 50, sh = 50, dx = 20, dy = 20, dw = 125, dh = 125 --- Pixel 69,69 should be red.] expected: FAIL + [Test scenario 10: sx = 0, sy = 0, sw = 50, sh = 50, dx = 0, dy = 0, dw = 200, dh = 200 --- Pixel 20,99 should be black.] + expected: FAIL + + [Test scenario 10: sx = 0, sy = 0, sw = 50, sh = 50, dx = 0, dy = 0, dw = 200, dh = 200 --- Pixel 99,20 should be black.] + expected: FAIL + + [Test scenario 10: sx = 0, sy = 0, sw = 50, sh = 50, dx = 0, dy = 0, dw = 200, dh = 200 --- Pixel 20,20 should be black.] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html.ini b/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html.ini new file mode 100644 index 00000000000..b1823dc9552 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html.ini @@ -0,0 +1,4 @@ +[2d.fillRect.shadow.html] + [fillRect draws shadows] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini new file mode 100644 index 00000000000..d058f7852d3 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.cone.behind.html] + [Canvas test: 2d.gradient.radial.cone.behind] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini new file mode 100644 index 00000000000..1bd5a8e4c2f --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.cone.beside.html] + [Canvas test: 2d.gradient.radial.cone.beside] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini new file mode 100644 index 00000000000..573e63a2f5d --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.cone.shape2.html] + [Canvas test: 2d.gradient.radial.cone.shape2] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini new file mode 100644 index 00000000000..c7e4cfa39c4 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.inside3.html] + [Canvas test: 2d.gradient.radial.inside3] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini new file mode 100644 index 00000000000..30ebbe345aa --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.outside2.html] + [Canvas test: 2d.gradient.radial.outside2] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini new file mode 100644 index 00000000000..de753c42d39 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.touch1.html] + [Canvas test: 2d.gradient.radial.touch1] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini new file mode 100644 index 00000000000..96b36eff7ea --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.touch2.html] + [Canvas test: 2d.gradient.radial.touch2] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini new file mode 100644 index 00000000000..b825bc15830 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini @@ -0,0 +1,4 @@ +[2d.gradient.radial.touch3.html] + [Canvas test: 2d.gradient.radial.touch3] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html.ini new file mode 100644 index 00000000000..8dc7eba742c --- /dev/null +++ b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html.ini @@ -0,0 +1,4 @@ +[2d.pattern.animated.gif.html] + [createPattern() of an animated GIF draws the first frame] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.closed.html.ini b/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.closed.html.ini new file mode 100644 index 00000000000..cbad443c3c7 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.closed.html.ini @@ -0,0 +1,4 @@ +[2d.line.cap.closed.html] + [Line caps are not drawn at the corners of an unclosed rectangle] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.round.html.ini b/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.round.html.ini new file mode 100644 index 00000000000..63fd4382c1e --- /dev/null +++ b/tests/wpt/metadata/2dcontext/line-styles/2d.line.cap.round.html.ini @@ -0,0 +1,4 @@ +[2d.line.cap.round.html] + [lineCap 'round' is rendered correctly] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.scale.2.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.scale.2.html.ini new file mode 100644 index 00000000000..72ac9cfb4dc --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.scale.2.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.scale.2.html] + [Highly scaled arcs are the right shape] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini new file mode 100644 index 00000000000..7c1f22ff41c --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.selfintersect.1.html] + [arc() with lineWidth > 2*radius is drawn sensibly] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.2.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.2.html.ini new file mode 100644 index 00000000000..a25bacaabed --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.selfintersect.2.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.selfintersect.2.html] + [arc() with lineWidth > 2*radius is drawn sensibly] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.3.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.3.html.ini new file mode 100644 index 00000000000..c285647918d --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.3.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.shape.3.html] + [arc() from 0 to -pi/2 does not draw anything in the wrong quadrant] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.4.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.4.html.ini new file mode 100644 index 00000000000..c22e98e44d2 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.shape.4.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.shape.4.html] + [arc() from 0 to -pi/2 draws stuff in the right quadrant] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.1.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.1.html.ini new file mode 100644 index 00000000000..522695b4c56 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.1.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.twopie.1.html] + [arc() draws nothing when end = start + 2pi-e and anticlockwise] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.3.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.3.html.ini new file mode 100644 index 00000000000..c1e40e7c3d9 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arc.twopie.3.html.ini @@ -0,0 +1,4 @@ +[2d.path.arc.twopie.3.html] + [arc() draws a full circle when end = start + 2pi+e and anticlockwise] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.ensuresubpath.2.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.ensuresubpath.2.html.ini new file mode 100644 index 00000000000..72a5d82aa29 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.ensuresubpath.2.html.ini @@ -0,0 +1,4 @@ +[2d.path.arcTo.ensuresubpath.2.html] + [If there is no subpath, the first control point is added] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.scale.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.scale.html.ini new file mode 100644 index 00000000000..583a1a2cf0c --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.scale.html.ini @@ -0,0 +1,4 @@ +[2d.path.arcTo.scale.html] + [arcTo scales the curve, not just the control points] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.shape.curve1.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.shape.curve1.html.ini deleted file mode 100644 index 170abb8500e..00000000000 --- a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.shape.curve1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.path.arcTo.shape.curve1.html] - type: testharness - [arcTo() curves in the right kind of shape] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.transformation.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.transformation.html.ini new file mode 100644 index 00000000000..569cfc2fb80 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.arcTo.transformation.html.ini @@ -0,0 +1,4 @@ +[2d.path.arcTo.transformation.html] + [arcTo joins up to the last subpath point correctly] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.closePath.nextpoint.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.closePath.nextpoint.html.ini new file mode 100644 index 00000000000..39f1fba043b --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.closePath.nextpoint.html.ini @@ -0,0 +1,4 @@ +[2d.path.closePath.nextpoint.html] + [Canvas test: 2d.path.closePath.nextpoint] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html.ini new file mode 100644 index 00000000000..b8ab96e6454 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html.ini @@ -0,0 +1,4 @@ +[2d.path.quadraticCurveTo.ensuresubpath.2.html] + [If there is no subpath, the first control point is added] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/path-objects/2d.path.rect.end.1.html.ini b/tests/wpt/metadata/2dcontext/path-objects/2d.path.rect.end.1.html.ini new file mode 100644 index 00000000000..1b05b57645f --- /dev/null +++ b/tests/wpt/metadata/2dcontext/path-objects/2d.path.rect.end.1.html.ini @@ -0,0 +1,4 @@ +[2d.path.rect.end.1.html] + [Canvas test: 2d.path.rect.end.1] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.2.html.ini new file mode 100644 index 00000000000..dbd2642e642 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.alpha.2.html] + [Shadow colour alpha components are used] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.3.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.3.html.ini new file mode 100644 index 00000000000..6541eaf9d0a --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.3.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.alpha.3.html] + [Shadows are affected by globalAlpha] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.4.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.4.html.ini new file mode 100644 index 00000000000..18495ce21c4 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.4.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.alpha.4.html] + [Shadows with alpha components are correctly affected by globalAlpha] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.5.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.5.html.ini new file mode 100644 index 00000000000..2902da69695 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.alpha.5.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.alpha.5.html] + [Shadows of shapes with alpha components are drawn correctly] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.alpha.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.alpha.html.ini new file mode 100644 index 00000000000..e025214a903 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.alpha.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.canvas.alpha.html] + [Shadows are drawn correctly for partially-transparent canvases] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.basic.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.basic.html.ini new file mode 100644 index 00000000000..5968020003f --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.basic.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.canvas.basic.html] + [Shadows are drawn for canvases] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.transparent.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.transparent.2.html.ini new file mode 100644 index 00000000000..36548a28349 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.canvas.transparent.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.canvas.transparent.2.html] + [Shadows are not drawn for transparent parts of canvases] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.1.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.1.html.ini new file mode 100644 index 00000000000..d794ecb8f7f --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.1.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.clip.1.html] + [Shadows of clipped shapes are still drawn within the clipping region] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.2.html.ini new file mode 100644 index 00000000000..ff8bfecd95b --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.clip.2.html] + [Shadows are not drawn outside the clipping region] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.3.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.3.html.ini new file mode 100644 index 00000000000..ddb4e15719b --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.clip.3.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.clip.3.html] + [Shadows of clipped shapes are still drawn within the clipping region] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.1.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.1.html.ini new file mode 100644 index 00000000000..183cec8f9e6 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.1.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.composite.1.html] + [Shadows are drawn using globalCompositeOperation] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.2.html.ini new file mode 100644 index 00000000000..f262fe31165 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.composite.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.composite.2.html] + [Shadows are drawn using globalCompositeOperation] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.alpha.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.alpha.html.ini new file mode 100644 index 00000000000..aca6bc8ecc0 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.alpha.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.gradient.alpha.html] + [Shadows are drawn correctly for partially-transparent gradient fills] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.basic.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.basic.html.ini new file mode 100644 index 00000000000..718711e1c92 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.basic.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.gradient.basic.html] + [Shadows are drawn for gradient fills] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.2.html.ini new file mode 100644 index 00000000000..b0f704f9217 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.gradient.transparent.2.html] + [Shadows are not drawn for transparent parts of gradient fills] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.alpha.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.alpha.html.ini new file mode 100644 index 00000000000..957d04b99f6 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.alpha.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.image.alpha.html] + [Shadows are drawn correctly for partially-transparent images] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.basic.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.basic.html.ini new file mode 100644 index 00000000000..81fa284a386 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.basic.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.image.basic.html] + [Shadows are drawn for images] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.scale.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.scale.html.ini new file mode 100644 index 00000000000..8cba6d0463e --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.scale.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.image.scale.html] + [Shadows are drawn correctly for scaled images] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.transparent.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.transparent.2.html.ini new file mode 100644 index 00000000000..fdc1a6c0a13 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.image.transparent.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.image.transparent.2.html] + [Shadows are not drawn for transparent parts of images] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeX.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeX.html.ini new file mode 100644 index 00000000000..7cab12e9647 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeX.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.offset.negativeX.html] + [Shadows can be offset with negative x] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeY.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeY.html.ini new file mode 100644 index 00000000000..f896a487854 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.negativeY.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.offset.negativeY.html] + [Shadows can be offset with negative y] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveX.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveX.html.ini new file mode 100644 index 00000000000..49b5d8a0927 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveX.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.offset.positiveX.html] + [Shadows can be offset with positive x] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveY.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveY.html.ini new file mode 100644 index 00000000000..1b25a3038d6 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.offset.positiveY.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.offset.positiveY.html] + [Shadows can be offset with positive y] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.outside.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.outside.html.ini new file mode 100644 index 00000000000..b65179a2088 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.outside.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.outside.html] + [Shadows of shapes outside the visible area can be offset onto the visible area] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.alpha.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.alpha.html.ini new file mode 100644 index 00000000000..fea2a9797f0 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.alpha.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.pattern.alpha.html] + [Shadows are drawn correctly for partially-transparent fill patterns] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.basic.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.basic.html.ini new file mode 100644 index 00000000000..7c68f2396b2 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.basic.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.pattern.basic.html] + [Shadows are drawn for fill patterns] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.transparent.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.transparent.2.html.ini new file mode 100644 index 00000000000..ee122e4fe1d --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.transparent.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.pattern.transparent.2.html] + [Shadows are not drawn for transparent parts of fill patterns] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.1.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.1.html.ini new file mode 100644 index 00000000000..13df839414b --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.1.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.transform.1.html] + [Shadows take account of transformations] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.2.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.2.html.ini new file mode 100644 index 00000000000..dba68f79426 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.transform.2.html.ini @@ -0,0 +1,4 @@ +[2d.shadow.transform.2.html] + [Shadow offsets are not affected by transformations] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/canvas_shadows_001.htm.ini b/tests/wpt/metadata/2dcontext/shadows/canvas_shadows_001.htm.ini new file mode 100644 index 00000000000..749b4504be4 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/canvas_shadows_001.htm.ini @@ -0,0 +1,4 @@ +[canvas_shadows_001.htm] + [linear gradient fillRect draws shadow (black rectange)] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/shadows/shadowBlur_gaussian_tolerance.1.html.ini b/tests/wpt/metadata/2dcontext/shadows/shadowBlur_gaussian_tolerance.1.html.ini new file mode 100644 index 00000000000..7fbc5cc5e81 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/shadows/shadowBlur_gaussian_tolerance.1.html.ini @@ -0,0 +1,10 @@ +[shadowBlur_gaussian_tolerance.1.html] + [shadowBlur Gaussian pixel values for small blur] + expected: FAIL + + [shadowBlur Gaussian pixel values for large blur] + expected: FAIL + + [shadowBlur Gaussian pixel values for no blur] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/transformations/2d.transformation.scale.large.html.ini b/tests/wpt/metadata/2dcontext/transformations/2d.transformation.scale.large.html.ini new file mode 100644 index 00000000000..a2f6ef4c2cb --- /dev/null +++ b/tests/wpt/metadata/2dcontext/transformations/2d.transformation.scale.large.html.ini @@ -0,0 +1,4 @@ +[2d.transformation.scale.large.html] + [scale() with large scale factors works] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/transformations/transform_a.html.ini b/tests/wpt/metadata/2dcontext/transformations/transform_a.html.ini new file mode 100644 index 00000000000..3196a3239fa --- /dev/null +++ b/tests/wpt/metadata/2dcontext/transformations/transform_a.html.ini @@ -0,0 +1,2 @@ +[transform_a.html] + expected: FAIL diff --git a/tests/wpt/metadata/css/css-paint-api/overdraw.https.html.ini b/tests/wpt/metadata/css/css-paint-api/overdraw.https.html.ini new file mode 100644 index 00000000000..4f18965fa1e --- /dev/null +++ b/tests/wpt/metadata/css/css-paint-api/overdraw.https.html.ini @@ -0,0 +1,2 @@ +[overdraw.https.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata/css/css-transforms/animation/perspective-interpolation.html.ini b/tests/wpt/metadata/css/css-transforms/animation/perspective-interpolation.html.ini index 03f2f3fe9d1..17b670fa9f5 100644 --- a/tests/wpt/metadata/css/css-transforms/animation/perspective-interpolation.html.ini +++ b/tests/wpt/metadata/css/css-transforms/animation/perspective-interpolation.html.ini @@ -1,5 +1,379 @@ [perspective-interpolation.html] - expected: CRASH [ perspective interpolation] expected: FAIL + [CSS Transitions: property from [inherit\] to [20px\] at (-0.3) should be [33px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (1.5) should be [125px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (-1) should be [none\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (1) should be [none\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (0.3) should be [50px\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (0.5) should be [20px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (1.5) should be [125px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (-20) should be [230px\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (0) should be [30px\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (1.5) should be [25px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (-1) should be [40px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (-0.3) should be [35px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (-20) should be [none\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (-20) should be [230px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (-1) should be [none\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (0.6) should be [16px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (1) should be [100px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (0.6) should be [16px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (1.5) should be [25px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (1.5) should be [125px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (1.5) should be [125px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (0) should be [30px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (0) should be [initial\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (-20) should be [none\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (0.3) should be [initial\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (-20) should be [none\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (-0.3) should be [35px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (-0.3) should be [initial\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (0.3) should be [unset\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (0) should be [unset\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (1.5) should be [none\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (-1) should be [none\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (0.3) should be [65px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (-1) should be [none\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (0.6) should be [24px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (-1) should be [none\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (-0.3) should be [7px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (0) should be [50px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (-0.3) should be [33px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (1.5) should be [25px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (0.3) should be [50px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (-20) should be [none\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (-0.3) should be [unset\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (1.5) should be [15px\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (0.6) should be [20px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (0.3) should be [65px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (0) should be [initial\]] + expected: FAIL + + [CSS Transitions: property from [inherit\] to [20px\] at (0.6) should be [24px\]] + expected: FAIL + + [CSS Transitions: property from [inherit\] to [20px\] at (-1) should be [40px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [50px\] to [100px\] at (0.6) should be [80px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (1) should be [100px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (0.3) should be [65px\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (0.6) should be [24px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (0.6) should be [24px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (-0.3) should be [7px\]] + expected: FAIL + + [CSS Transitions: property from [inherit\] to [20px\] at (0.3) should be [27px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (-20) should be [230px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (1.5) should be [15px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (0.6) should be [none\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (0.3) should be [unset\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (-1) should be [none\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (0.5) should be [none\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (0.6) should be [80px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (0.3) should be [27px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (1.5) should be [20px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (-0.3) should be [50px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (0.6) should be [none\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (0.5) should be [20px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (0.6) should be [80px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (-20) should be [none\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (-0.3) should be [35px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (-20) should be [none\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (0.3) should be [13px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (0.6) should be [80px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (0) should be [50px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (0.6) should be [16px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (-0.3) should be [50px\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (0.3) should be [13px\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (0) should be [unset\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (0.5) should be [20px\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (1.5) should be [20px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (0.6) should be [20px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (-0.3) should be [33px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (0) should be [50px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (0.5) should be [20px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (0.3) should be [13px\]] + expected: FAIL + + [CSS Transitions: property from [inherit\] to [20px\] at (-20) should be [230px\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (0.5) should be [none\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (0) should be [10px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (0.6) should be [20px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (1.5) should be [15px\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (-1) should be [none\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (-20) should be [none\]] + expected: FAIL + + [CSS Transitions with transition: all: property from neutral to [20px\] at (0.3) should be [13px\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (1) should be [20px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (-0.3) should be [35px\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (1.5) should be [25px\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (-0.3) should be [7px\]] + expected: FAIL + + [CSS Transitions: property from [50px\] to [100px\] at (0.3) should be [65px\]] + expected: FAIL + + [CSS Transitions: property from [inherit\] to [20px\] at (1.5) should be [15px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (1) should be [20px\]] + expected: FAIL + + [Web Animations: property from neutral to [20px\] at (1) should be [20px\]] + expected: FAIL + + [CSS Animations: property from neutral to [20px\] at (-0.3) should be [7px\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (0.6) should be [20px\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (0.6) should be [16px\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [100px\] at (0) should be [50px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (-0.3) should be [33px\]] + expected: FAIL + + [Web Animations: property from [initial\] to [20px\] at (-0.3) should be [initial\]] + expected: FAIL + + [CSS Animations: property from [50px\] to [none\] at (1.5) should be [none\]] + expected: FAIL + + [Web Animations: property from [unset\] to [20px\] at (-0.3) should be [unset\]] + expected: FAIL + + [Web Animations: property from [50px\] to [100px\] at (-20) should be [none\]] + expected: FAIL + + [CSS Transitions: property from neutral to [20px\] at (-1) should be [none\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (-1) should be [40px\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [inherit\] to [20px\] at (-1) should be [40px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (1.5) should be [20px\]] + expected: FAIL + + [CSS Animations: property from [unset\] to [20px\] at (1.5) should be [20px\]] + expected: FAIL + + [CSS Animations: property from [initial\] to [20px\] at (0.3) should be [initial\]] + expected: FAIL + + [Web Animations: property from [50px\] to [none\] at (1) should be [none\]] + expected: FAIL + + [CSS Animations: property from [inherit\] to [20px\] at (0.3) should be [27px\]] + expected: FAIL + + [Web Animations: property from [inherit\] to [20px\] at (0.3) should be [27px\]] + expected: FAIL + diff --git a/tests/wpt/metadata/css/css-transitions/no-transition-from-ua-to-blocking-stylesheet.html.ini b/tests/wpt/metadata/css/css-transitions/no-transition-from-ua-to-blocking-stylesheet.html.ini index e35a452a186..70a00a101f6 100644 --- a/tests/wpt/metadata/css/css-transitions/no-transition-from-ua-to-blocking-stylesheet.html.ini +++ b/tests/wpt/metadata/css/css-transitions/no-transition-from-ua-to-blocking-stylesheet.html.ini @@ -1,2 +1,2 @@ [no-transition-from-ua-to-blocking-stylesheet.html] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata/css/cssom-view/MediaQueryListEvent.html.ini b/tests/wpt/metadata/css/cssom-view/MediaQueryListEvent.html.ini new file mode 100644 index 00000000000..61d0496ba40 --- /dev/null +++ b/tests/wpt/metadata/css/cssom-view/MediaQueryListEvent.html.ini @@ -0,0 +1,4 @@ +[MediaQueryListEvent.html] + [argument of onchange] + expected: FAIL + diff --git a/tests/wpt/metadata/css/cssom-view/offsetTopLeft-border-box.html.ini b/tests/wpt/metadata/css/cssom-view/offsetTopLeft-border-box.html.ini new file mode 100644 index 00000000000..239c35135e4 --- /dev/null +++ b/tests/wpt/metadata/css/cssom-view/offsetTopLeft-border-box.html.ini @@ -0,0 +1,7 @@ +[offsetTopLeft-border-box.html] + [container: 1] + expected: FAIL + + [container: 0] + expected: FAIL + diff --git a/tests/wpt/metadata/encoding/single-byte-decoder.html.ini b/tests/wpt/metadata/encoding/single-byte-decoder.html.ini index 939a36eb9d9..3d135f3bd66 100644 --- a/tests/wpt/metadata/encoding/single-byte-decoder.html.ini +++ b/tests/wpt/metadata/encoding/single-byte-decoder.html.ini @@ -2,6 +2,7 @@ type: testharness [single-byte-decoder.html?document] + expected: TIMEOUT [ISO-8859-4: iso_8859-4:1988 (document.characterSet and document.inputEncoding)] expected: FAIL diff --git a/tests/wpt/metadata/fetch/content-type/response.window.js.ini b/tests/wpt/metadata/fetch/content-type/response.window.js.ini index 3d77dd6fefc..043922cce77 100644 --- a/tests/wpt/metadata/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata/fetch/content-type/response.window.js.ini @@ -315,18 +315,9 @@ [