diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-20 03:12:47 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-20 03:12:47 -0600 |
commit | dea36f981650f027902b4f71f0cdabd2da69fe21 (patch) | |
tree | 3b22140821d0018583a02b55940b0a982f0bda06 | |
parent | 459c35441612d3247450e253b1dcd0bc003985ae (diff) | |
parent | d3199aef74b548b9afe8281db3a6fe67b7a03874 (diff) | |
download | servo-dea36f981650f027902b4f71f0cdabd2da69fe21.tar.gz servo-dea36f981650f027902b4f71f0cdabd2da69fe21.zip |
auto merge of #4891 : mmatyas/servo/canvas_gradient, r=jdm
Based on [ebalint](https://github.com/ebalint)'s original patch, this commit implements the linear and radial gradients for the canvas. The PR also includes test cases.
Depends on #4623 and servo/rust-azure#136.
55 files changed, 290 insertions, 228 deletions
diff --git a/components/canvas/canvas_paint_task.rs b/components/canvas/canvas_paint_task.rs index 5fcd245a2f2..11186003c96 100644 --- a/components/canvas/canvas_paint_task.rs +++ b/components/canvas/canvas_paint_task.rs @@ -5,6 +5,7 @@ use azure::azure::AzFloat; use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions, Pattern}; use azure::azure_hl::{ColorPattern, PathBuilder, JoinStyle, CapStyle, DrawSurfaceOptions, Filter}; +use azure::azure_hl::{GradientStop, LinearGradientPattern, RadialGradientPattern, ExtendMode}; use geom::matrix2d::Matrix2D; use geom::point::Point2D; use geom::rect::Rect; @@ -167,11 +168,11 @@ impl<'a> CanvasPaintTask<'a> { } fn set_fill_style(&mut self, style: FillOrStrokeStyle) { - self.fill_style = style.to_azure_pattern() + self.fill_style = style.to_azure_pattern(&self.drawtarget) } fn set_stroke_style(&mut self, style: FillOrStrokeStyle) { - self.stroke_style = style.to_azure_pattern() + self.stroke_style = style.to_azure_pattern(&self.drawtarget) } fn set_transform(&mut self, transform: &Matrix2D<f32>) { @@ -292,20 +293,104 @@ impl<'a> CanvasPaintTask<'a> { } #[derive(Clone)] +pub struct CanvasGradientStop { + pub offset: f64, + pub color: RGBA, +} + +#[derive(Clone)] +pub struct LinearGradientStyle { + pub x0: f64, + pub y0: f64, + pub x1: f64, + pub y1: f64, + pub stops: Vec<CanvasGradientStop> +} + +impl LinearGradientStyle { + pub fn new(x0: f64, y0: f64, x1: f64, y1: f64, stops: Vec<CanvasGradientStop>) + -> LinearGradientStyle { + LinearGradientStyle { + x0: x0, + y0: y0, + x1: x1, + y1: y1, + stops: stops, + } + } +} + +#[derive(Clone)] +pub struct RadialGradientStyle { + pub x0: f64, + pub y0: f64, + pub r0: f64, + pub x1: f64, + pub y1: f64, + pub r1: f64, + pub stops: Vec<CanvasGradientStop> +} + +impl RadialGradientStyle { + pub fn new(x0: f64, y0: f64, r0: f64, x1: f64, y1: f64, r1: f64, stops: Vec<CanvasGradientStop>) + -> RadialGradientStyle { + RadialGradientStyle { + x0: x0, + y0: y0, + r0: r0, + x1: x1, + y1: y1, + r1: r1, + stops: stops, + } + } +} + +#[derive(Clone)] pub enum FillOrStrokeStyle { Color(RGBA), + LinearGradient(LinearGradientStyle), + RadialGradient(RadialGradientStyle), } impl FillOrStrokeStyle { - fn to_azure_pattern(&self) -> Pattern { + fn to_azure_pattern(&self, drawtarget: &DrawTarget) -> Pattern { match *self { FillOrStrokeStyle::Color(ref color) => { Pattern::Color(ColorPattern::new(color::new(color.red, color.green, color.blue, color.alpha))) + }, + FillOrStrokeStyle::LinearGradient(ref linear_gradient_style) => { + let gradient_stops: Vec<GradientStop> = linear_gradient_style.stops.iter().map(|s| { + GradientStop { + offset: s.offset as AzFloat, + color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha) + } + }).collect(); + + Pattern::LinearGradient(LinearGradientPattern::new( + &Point2D(linear_gradient_style.x0 as AzFloat, linear_gradient_style.y0 as AzFloat), + &Point2D(linear_gradient_style.x1 as AzFloat, linear_gradient_style.y1 as AzFloat), + drawtarget.create_gradient_stops(gradient_stops.as_slice(), ExtendMode::Clamp), + &Matrix2D::identity())) + }, + FillOrStrokeStyle::RadialGradient(ref radial_gradient_style) => { + let gradient_stops: Vec<GradientStop> = radial_gradient_style.stops.iter().map(|s| { + GradientStop { + offset: s.offset as AzFloat, + color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha) + } + }).collect(); + + Pattern::RadialGradient(RadialGradientPattern::new( + &Point2D(radial_gradient_style.x0 as AzFloat, radial_gradient_style.y0 as AzFloat), + &Point2D(radial_gradient_style.x1 as AzFloat, radial_gradient_style.y1 as AzFloat), + radial_gradient_style.r0 as AzFloat, radial_gradient_style.r1 as AzFloat, + drawtarget.create_gradient_stops(gradient_stops.as_slice(), ExtendMode::Clamp), + &Matrix2D::identity())) } } } } - diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 505307dd7bf..9e7b7012190 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -34,6 +34,7 @@ use dom::bindings::refcounted::Trusted; use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler}; use script_task::ScriptChan; +use canvas::canvas_paint_task::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle}; use cssparser::RGBA; use encoding::types::EncodingRef; use geom::matrix2d::Matrix2D; @@ -233,6 +234,7 @@ no_jsmanaged_fields!(LengthOrPercentageOrAuto); no_jsmanaged_fields!(RGBA); no_jsmanaged_fields!(Matrix2D<T>); no_jsmanaged_fields!(StorageType); +no_jsmanaged_fields!(CanvasGradientStop, LinearGradientStyle, RadialGradientStyle); impl JSTraceable for Box<ScriptChan+Send> { #[inline] diff --git a/components/script/dom/canvasgradient.rs b/components/script/dom/canvasgradient.rs index def78ca7f33..c1e61a12c26 100644 --- a/components/script/dom/canvasgradient.rs +++ b/components/script/dom/canvasgradient.rs @@ -2,10 +2,80 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::Reflector; +use cssparser::RGBA; +use canvas::canvas_paint_task::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle}; +use dom::bindings::cell::DOMRefCell; +use dom::bindings::codegen::Bindings::CanvasGradientBinding; +use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods; +use dom::bindings::global::GlobalRef; +use dom::bindings::js::{JSRef, Temporary}; +use dom::bindings::utils::{Reflector, reflect_dom_object}; +use dom::canvasrenderingcontext2d::parse_color; #[dom_struct] pub struct CanvasGradient { reflector_: Reflector, + style: CanvasGradientStyle, + stops: DOMRefCell<Vec<CanvasGradientStop>>, } +#[jstraceable] +pub enum CanvasGradientStyle { + Linear(LinearGradientStyle), + Radial(RadialGradientStyle), +} + +impl CanvasGradient { + fn new_inherited(style: CanvasGradientStyle) -> CanvasGradient { + CanvasGradient { + reflector_: Reflector::new(), + style: style, + stops: DOMRefCell::new(Vec::new()), + } + } + + pub fn new(global: GlobalRef, style: CanvasGradientStyle) -> Temporary<CanvasGradient> { + reflect_dom_object(box CanvasGradient::new_inherited(style), + global, CanvasGradientBinding::Wrap) + } +} + +impl<'a> CanvasGradientMethods for JSRef<'a, CanvasGradient> { + fn AddColorStop(self, offset: f32, color: String) { + let default_black = RGBA { + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 1.0, + }; + + self.stops.borrow_mut().push(CanvasGradientStop { + offset: offset as f64, + color: parse_color(color.as_slice()).unwrap_or(default_black), + }); + } +} + +pub trait ToFillOrStrokeStyle { + fn to_fill_or_stroke_style(&self) -> FillOrStrokeStyle; +} + +impl<'a> ToFillOrStrokeStyle for JSRef<'a, CanvasGradient> { + fn to_fill_or_stroke_style(&self) -> FillOrStrokeStyle { + let gradient_stops = self.stops.borrow().clone(); + match self.style { + CanvasGradientStyle::Linear(ref gradient) => { + FillOrStrokeStyle::LinearGradient( + LinearGradientStyle::new(gradient.x0, gradient.y0, + gradient.x1, gradient.y1, + gradient_stops)) + }, + CanvasGradientStyle::Radial(ref gradient) => { + FillOrStrokeStyle::RadialGradient( + RadialGradientStyle::new(gradient.x0, gradient.y0, gradient.r0, + gradient.x1, gradient.y1, gradient.r1, + gradient_stops)) + } + } + } +} diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index d481aca911f..a029b3d3c54 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -7,11 +7,12 @@ use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasRen use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasWindingRule; use dom::bindings::codegen::Bindings::ImageDataBinding::ImageDataMethods; use dom::bindings::codegen::UnionTypes::StringOrCanvasGradientOrCanvasPattern; -use dom::bindings::error::Error::IndexSize; +use dom::bindings::error::Error::{IndexSize, TypeError}; use dom::bindings::error::Fallible; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::{JS, JSRef, LayoutJS, Temporary}; use dom::bindings::utils::{Reflector, reflect_dom_object}; +use dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle}; use dom::htmlcanvaselement::{HTMLCanvasElement, HTMLCanvasElementHelpers}; use dom::imagedata::{ImageData, ImageDataHelpers}; @@ -23,7 +24,9 @@ use geom::rect::Rect; use geom::size::Size2D; use canvas::canvas_paint_task::{CanvasMsg, CanvasPaintTask, FillOrStrokeStyle}; +use canvas::canvas_paint_task::{LinearGradientStyle, RadialGradientStyle}; +use std::borrow::ToOwned; use std::cell::Cell; use std::num::{Float, ToPrimitive}; use std::sync::mpsc::{channel, Sender}; @@ -215,6 +218,9 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D> _ => {} } } + StringOrCanvasGradientOrCanvasPattern::eCanvasGradient(gradient) => { + self.renderer.send(CanvasMsg::SetFillStyle(gradient.root().r().to_fill_or_stroke_style())).unwrap(); + } _ => {} } } @@ -264,6 +270,22 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D> let canvas_size = self.canvas.root().r().get_size(); self.renderer.send(CanvasMsg::PutImageData(data, image_data_rect, dirty_rect, canvas_size)).unwrap() } + + fn CreateLinearGradient(self, x0: f64, y0: f64, x1: f64, y1: f64) -> Fallible<Temporary<CanvasGradient>> { + if [x0, y0, x1, y1].iter().any(|x| x.is_nan() || x.is_infinite()) { + return Err(TypeError("One of the arguments of createLinearGradient() is not a finite floating-point value.".to_owned())); + } + Ok(CanvasGradient::new(self.global.root().r(), + CanvasGradientStyle::Linear(LinearGradientStyle::new(x0, y0, x1, y1, Vec::new())))) + } + + fn CreateRadialGradient(self, x0: f64, y0: f64, r0: f64, x1: f64, y1: f64, r1: f64) -> Fallible<Temporary<CanvasGradient>> { + if [x0, y0, r0, x1, y1, r1].iter().any(|x| x.is_nan() || x.is_infinite()) { + return Err(TypeError("One of the arguments of createRadialGradient() is not a finite floating-point value.".to_owned())); + } + Ok(CanvasGradient::new(self.global.root().r(), + CanvasGradientStyle::Radial(RadialGradientStyle::new(x0, y0, r0, x1, y1, r1, Vec::new())))) + } } #[unsafe_destructor] diff --git a/components/script/dom/webidls/CanvasGradient.webidl b/components/script/dom/webidls/CanvasGradient.webidl index 1dc1ac4c1f0..fbeab843987 100644 --- a/components/script/dom/webidls/CanvasGradient.webidl +++ b/components/script/dom/webidls/CanvasGradient.webidl @@ -6,7 +6,7 @@ interface CanvasGradient { // opaque object // addColorStop should take a double - //void addColorStop(float offset, DOMString color); + void addColorStop(float offset, DOMString color); }; diff --git a/components/script/dom/webidls/CanvasRenderingContext2D.webidl b/components/script/dom/webidls/CanvasRenderingContext2D.webidl index f9a4c7b68f8..e0861f02cbd 100644 --- a/components/script/dom/webidls/CanvasRenderingContext2D.webidl +++ b/components/script/dom/webidls/CanvasRenderingContext2D.webidl @@ -52,8 +52,10 @@ interface CanvasRenderingContext2D { // colours and styles (see also the CanvasDrawingStyles interface) attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black) attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black) - //CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1); - //CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); + [Throws] + CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1); + [Throws] + CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); //CanvasPattern createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition); // shadows diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 680b98486f1..1702516ae80 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -30,7 +30,7 @@ source = "git+https://github.com/tomaka/android-rs-glue#5a68056599fb498b0cf3715f [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#3fa95e4ce2c12234e75b7a68b1a2542e3804b67c" +source = "git+https://github.com/servo/rust-azure#110b98c7d39a275513c654644311f26b7eb75580" dependencies = [ "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index dcb351953e5..18cc8ae41ed 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -36,7 +36,7 @@ source = "git+https://github.com/tomaka/android-rs-glue#5a68056599fb498b0cf3715f [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#3fa95e4ce2c12234e75b7a68b1a2542e3804b67c" +source = "git+https://github.com/servo/rust-azure#110b98c7d39a275513c654644311f26b7eb75580" dependencies = [ "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index b4ea096e746..d0f15a159ae 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#3fa95e4ce2c12234e75b7a68b1a2542e3804b67c" +source = "git+https://github.com/servo/rust-azure#110b98c7d39a275513c654644311f26b7eb75580" dependencies = [ "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", diff --git a/tests/ref/basic.list b/tests/ref/basic.list index ea43fdd0d20..d4f0bde917a 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -65,7 +65,9 @@ flaky_cpu == append_style_a.html append_style_b.html == box_sizing_sanity_check_a.html box_sizing_sanity_check_ref.html == br.html br-ref.html == canvas_as_block_element_a.html canvas_as_block_element_ref.html +== canvas_linear_gradient_a.html canvas_linear_gradient_ref.html == canvas_lineto_a.html canvas_lineto_ref.html +== canvas_radial_gradient_a.html canvas_radial_gradient_ref.html == canvas_transform_a.html canvas_transform_ref.html == case-insensitive-font-family.html case-insensitive-font-family-ref.html == clear_generated_content_table_a.html clear_generated_content_table_ref.html diff --git a/tests/ref/canvas_linear_gradient_a.html b/tests/ref/canvas_linear_gradient_a.html new file mode 100644 index 00000000000..5fc3f259e0a --- /dev/null +++ b/tests/ref/canvas_linear_gradient_a.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<body> +<style> + html, body { + margin: 0; + padding: 0; + } + canvas { + background-color: green; + } +</style> + +<canvas id="c" width="200" height="200"> +Your browser does not support the HTML5 canvas tag.</canvas> + +<script> +var c = document.getElementById("c"); +var ctx = c.getContext("2d"); + +var grd = ctx.createLinearGradient(10, 0, 190, 0); +grd.addColorStop(0, "red"); +grd.addColorStop(1, "yellow"); + +ctx.fillStyle = grd; +ctx.fillRect(10, 10, 180, 180); +</script> + +</body> +</html> diff --git a/tests/ref/canvas_linear_gradient_ref.html b/tests/ref/canvas_linear_gradient_ref.html new file mode 100644 index 00000000000..b820555a7d3 --- /dev/null +++ b/tests/ref/canvas_linear_gradient_ref.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<body> +<style> + html, body { + margin: 0; + padding: 0; + } + section, div { + width: 180px; + height: 180px; + } + section { + padding: 10px; + background-color: green; + } + div { + background: linear-gradient(to right, red, yellow); + } +</style> +<section><div></div></section> +</body> +</html> diff --git a/tests/ref/canvas_radial_gradient.png b/tests/ref/canvas_radial_gradient.png Binary files differnew file mode 100644 index 00000000000..0192aa2b240 --- /dev/null +++ b/tests/ref/canvas_radial_gradient.png diff --git a/tests/ref/canvas_radial_gradient_a.html b/tests/ref/canvas_radial_gradient_a.html new file mode 100644 index 00000000000..7fe5f8e4186 --- /dev/null +++ b/tests/ref/canvas_radial_gradient_a.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<body> +<style> + html, body { + margin: 0; + padding: 0; + } + canvas { + background-color: green; + } +</style> + +<canvas id="c" width="200" height="200"> +Your browser does not support the HTML5 canvas tag.</canvas> + +<script> +var c = document.getElementById("c"); +var ctx = c.getContext("2d"); + +var grd = ctx.createRadialGradient(60, 60, 0, 60, 60, 150); +grd.addColorStop(0, "red"); +grd.addColorStop(1, "yellow"); + +ctx.fillStyle = grd; +ctx.fillRect(10, 10, 180, 180); +</script> + +</body> +</html> diff --git a/tests/ref/canvas_radial_gradient_ref.html b/tests/ref/canvas_radial_gradient_ref.html new file mode 100644 index 00000000000..4376341d31b --- /dev/null +++ b/tests/ref/canvas_radial_gradient_ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<body> +<style> + html, body { + margin: 0; + padding: 0; + } +</style> +<img src="canvas_radial_gradient.png"> +</body> +</html> diff --git a/tests/wpt/metadata/2dcontext/conformance-requirements/2d.missingargs.html.ini b/tests/wpt/metadata/2dcontext/conformance-requirements/2d.missingargs.html.ini deleted file mode 100644 index ce1cd9d0ff6..00000000000 --- a/tests/wpt/metadata/2dcontext/conformance-requirements/2d.missingargs.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.missingargs.html] - type: testharness - [Missing arguments cause TypeError] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html.ini deleted file mode 100644 index 6be9b274256..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.empty.html] - type: testharness - [Canvas test: 2d.gradient.empty] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html.ini deleted file mode 100644 index 2da3282dd8e..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.alpha.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.alpha] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html.ini deleted file mode 100644 index ec79d4dbc5f..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.colour.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.colour] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html.ini deleted file mode 100644 index c8562bae0e3..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.multiple.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.multiple] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html.ini deleted file mode 100644 index 8cba4c2b674..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.outside.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.outside] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini deleted file mode 100644 index a89907b67db..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.overlap.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.overlap] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html.ini deleted file mode 100644 index af56df25104..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.overlap2.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.overlap2] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html.ini deleted file mode 100644 index ce470eb581d..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.solid.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.solid] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html.ini deleted file mode 100644 index 6d1e4837b87..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.interpolate.vertical.html] - type: testharness - [Canvas test: 2d.gradient.interpolate.vertical] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html.ini deleted file mode 100644 index de4f2bddebe..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.linear.transform.1.html] - type: testharness - [Linear gradient coordinates are relative to the coordinate space at the time of filling] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html.ini deleted file mode 100644 index d7de096f800..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.linear.transform.2.html] - type: testharness - [Linear gradient coordinates are relative to the coordinate space at the time of filling] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html.ini deleted file mode 100644 index 8f6a7dd384f..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.linear.transform.3.html] - type: testharness - [Linear gradient transforms do not experience broken caching effects] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html.ini deleted file mode 100644 index 19d23d2d188..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.object.crosscanvas.html] - type: testharness - [Canvas test: 2d.gradient.object.crosscanvas] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html.ini deleted file mode 100644 index c849f911b7f..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.object.current.html] - type: testharness - [Canvas test: 2d.gradient.object.current] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html.ini deleted file mode 100644 index 471d071ccf1..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.object.return.html] - type: testharness - [createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html.ini deleted file mode 100644 index 0f94a1ea962..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.object.type.html] - type: testharness - [window.CanvasGradient exists and has the right properties] - 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 deleted file mode 100644 index db248f89ae4..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.behind.html] - type: testharness - [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 deleted file mode 100644 index 2283a856053..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.beside.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.beside] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html.ini deleted file mode 100644 index fa196ab8fce..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.bottom.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.bottom] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html.ini deleted file mode 100644 index 5280a598777..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.cylinder.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.cylinder] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html.ini deleted file mode 100644 index ba4f90807cf..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.front.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.front] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html.ini deleted file mode 100644 index 7f85b8a7964..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.shape1.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.shape1] - 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 deleted file mode 100644 index ac163231f8b..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.shape2.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.shape2] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html.ini deleted file mode 100644 index 0b5e6257889..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.cone.top.html] - type: testharness - [Canvas test: 2d.gradient.radial.cone.top] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html.ini deleted file mode 100644 index 32ab0251122..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.equal.html] - type: testharness - [Canvas test: 2d.gradient.radial.equal] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html.ini deleted file mode 100644 index 008c2bdcf2b..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.inside1.html] - type: testharness - [Canvas test: 2d.gradient.radial.inside1] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html.ini deleted file mode 100644 index 4a877166ec5..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.inside2.html] - type: testharness - [Canvas test: 2d.gradient.radial.inside2] - 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 deleted file mode 100644 index efb6671ff96..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.inside3.html] - type: testharness - [Canvas test: 2d.gradient.radial.inside3] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html.ini deleted file mode 100644 index f04fb4e2e55..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.outside1.html] - type: testharness - [Canvas test: 2d.gradient.radial.outside1] - 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 deleted file mode 100644 index ae7beeb2c2d..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.outside2.html] - type: testharness - [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 deleted file mode 100644 index df30497660a..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.touch1.html] - type: testharness - [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 deleted file mode 100644 index 53c8947f53c..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.touch2.html] - type: testharness - [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 deleted file mode 100644 index 354a08d0728..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.touch3.html] - type: testharness - [Canvas test: 2d.gradient.radial.touch3] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html.ini deleted file mode 100644 index 3110be91ce8..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.transform.1.html] - type: testharness - [Radial gradient coordinates are relative to the coordinate space at the time of filling] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html.ini deleted file mode 100644 index 047159c7a5f..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.transform.2.html] - type: testharness - [Radial gradient coordinates are relative to the coordinate space at the time of filling] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html.ini b/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html.ini deleted file mode 100644 index a19423b6ad4..00000000000 --- a/tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.gradient.radial.transform.3.html] - type: testharness - [Radial gradient transforms do not experience broken caching effects] - expected: FAIL - diff --git a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.1.html.ini b/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.1.html.ini deleted file mode 100644 index f52099df851..00000000000 --- a/tests/wpt/metadata/2dcontext/shadows/2d.shadow.gradient.transparent.1.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.shadow.gradient.transparent.1.html] - type: testharness - [Shadows are not drawn for transparent gradient fills] - expected: FAIL - diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index 5977047f9e5..b028601eed9 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -6978,12 +6978,6 @@ [CanvasRenderingContext2D interface: attribute imageSmoothingEnabled] expected: FAIL - [CanvasRenderingContext2D interface: operation createLinearGradient(double,double,double,double)] - expected: FAIL - - [CanvasRenderingContext2D interface: operation createRadialGradient(double,double,double,double,double,double)] - expected: FAIL - [CanvasRenderingContext2D interface: operation createPattern(CanvasImageSource,DOMString)] expected: FAIL @@ -7170,18 +7164,6 @@ [CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillStyle" with the proper type (17)] expected: FAIL - [CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createLinearGradient" with the proper type (18)] - expected: FAIL - - [CanvasRenderingContext2D interface: calling createLinearGradient(double,double,double,double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError] - expected: FAIL - - [CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createRadialGradient" with the proper type (19)] - expected: FAIL - - [CanvasRenderingContext2D interface: calling createRadialGradient(double,double,double,double,double,double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError] - expected: FAIL - [CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createPattern" with the proper type (20)] expected: FAIL @@ -7401,9 +7383,6 @@ [CanvasGradient interface object length] expected: FAIL - [CanvasGradient interface: operation addColorStop(double,DOMString)] - expected: FAIL - [CanvasPattern interface object length] expected: FAIL diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html.ini deleted file mode 100644 index c2652dc9ee6..00000000000 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[initial.reset.gradient.html] - type: testharness - [Resetting the canvas state does not invalidate any existing gradients] - expected: FAIL - |