From 5c7d5dfcc02220eccfc84f3e285957dd7f404177 Mon Sep 17 00:00:00 2001 From: Mohamed Mostafa Date: Thu, 16 Jul 2026 16:33:30 +0800 Subject: [PATCH 1/3] Create Dom Elements for SVG types Signed-off-by: Mohamed Mostafa --- Cargo.lock | 22 +- Cargo.toml | 16 +- components/script/dom/element/create.rs | 28 ++ components/script/dom/node/virtualmethods.rs | 67 +++- components/script/dom/svg/mod.rs | 16 + components/script/dom/svg/svgcircleelement.rs | 54 +++ components/script/dom/svg/svgdefselement.rs | 52 +++ components/script/dom/svg/svgelement.rs | 115 +++++- .../script/dom/svg/svgellipseelement.rs | 54 +++ components/script/dom/svg/svggelement.rs | 52 +++ .../script/dom/svg/svggeometryelement.rs | 51 +++ .../script/dom/svg/svggradientelement.rs | 49 +++ .../dom/svg/svglineargradientelement.rs | 54 +++ components/script/dom/svg/svglineelement.rs | 52 +++ components/script/dom/svg/svgpathelement.rs | 52 +++ .../script/dom/svg/svgpolygonelement.rs | 54 +++ .../script/dom/svg/svgpolylineelement.rs | 54 +++ .../dom/svg/svgradialgradientelement.rs | 54 +++ components/script/dom/svg/svgrectelement.rs | 52 +++ components/script/dom/svg/svgstopelement.rs | 58 +++ components/script/dom/svg/svgsymbolelement.rs | 54 +++ components/script/dom/svg/svguseelement.rs | 52 +++ .../webidls/SVGCircleElement.webidl | 11 + .../webidls/SVGDefsElement.webidl | 8 + .../webidls/SVGEllipseElement.webidl | 12 + .../webidls/SVGGElement.webidl | 8 + .../webidls/SVGGeometryElement.webidl | 14 + .../webidls/SVGGradientElement.webidl | 20 + .../webidls/SVGLineElement.webidl | 12 + .../webidls/SVGLinearGradientElement.webidl | 12 + .../webidls/SVGPathElement.webidl | 8 + .../webidls/SVGPolygonElement.webidl | 10 + .../webidls/SVGPolylineElement.webidl | 10 + .../webidls/SVGRadialGradientElement.webidl | 14 + .../webidls/SVGRectElement.webidl | 14 + .../webidls/SVGStopElement.webidl | 9 + .../webidls/SVGSymbolElement.webidl | 10 + .../webidls/SVGUseElement.webidl | 16 + ...ement-request-fullscreen-svg-rect.html.ini | 3 - .../spaces-at-end-of-path-data.html.ini | 3 + .../animations/cx-composition.html.ini | 3 - .../animations/cy-composition.html.ini | 3 - .../animations/r-composition.html.ini | 3 - .../animations/rx-composition.html.ini | 3 - .../animations/ry-composition.html.ini | 3 - .../animations/x-composition.html.ini | 3 - .../animations/y-composition.html.ini | 3 - tests/wpt/meta/svg/historical.html.ini | 3 - tests/wpt/meta/svg/idlharness.window.js.ini | 348 ------------------ ...resentation-attributes-irrelevant.html.ini | 9 - .../presentation-attributes-relevant.html.ini | 15 - ...entation-attributes-special-cases.html.ini | 3 + .../presentation-attributes-unknown.html.ini | 9 - ...-origin-frame.tentative.sub.https.html.ini | 2 - ...same-origin-frame.tentative.https.html.ini | 2 - ...-origin-frame.tentative.sub.https.html.ini | 2 - ...-srcdoc-frame.tentative.sub.https.html.ini | 2 - ...-origin-frame.tentative.sub.https.html.ini | 2 - ...reload-as-sandbox.tentative.https.html.ini | 2 - ...der-sandbox-frame.tentative.https.html.ini | 2 - ...render-web-plugin.tentative.https.html.ini | 2 - tests/wpt/mozilla/meta/MANIFEST.json | 2 +- .../tests/css/css-property-listing.html | 16 + .../tests/mozilla/interfaces.https.html | 16 + 64 files changed, 1318 insertions(+), 446 deletions(-) create mode 100644 components/script/dom/svg/svgcircleelement.rs create mode 100644 components/script/dom/svg/svgdefselement.rs create mode 100644 components/script/dom/svg/svgellipseelement.rs create mode 100644 components/script/dom/svg/svggelement.rs create mode 100644 components/script/dom/svg/svggeometryelement.rs create mode 100644 components/script/dom/svg/svggradientelement.rs create mode 100644 components/script/dom/svg/svglineargradientelement.rs create mode 100644 components/script/dom/svg/svglineelement.rs create mode 100644 components/script/dom/svg/svgpathelement.rs create mode 100644 components/script/dom/svg/svgpolygonelement.rs create mode 100644 components/script/dom/svg/svgpolylineelement.rs create mode 100644 components/script/dom/svg/svgradialgradientelement.rs create mode 100644 components/script/dom/svg/svgrectelement.rs create mode 100644 components/script/dom/svg/svgstopelement.rs create mode 100644 components/script/dom/svg/svgsymbolelement.rs create mode 100644 components/script/dom/svg/svguseelement.rs create mode 100644 components/script_bindings/webidls/SVGCircleElement.webidl create mode 100644 components/script_bindings/webidls/SVGDefsElement.webidl create mode 100644 components/script_bindings/webidls/SVGEllipseElement.webidl create mode 100644 components/script_bindings/webidls/SVGGElement.webidl create mode 100644 components/script_bindings/webidls/SVGGeometryElement.webidl create mode 100644 components/script_bindings/webidls/SVGGradientElement.webidl create mode 100644 components/script_bindings/webidls/SVGLineElement.webidl create mode 100644 components/script_bindings/webidls/SVGLinearGradientElement.webidl create mode 100644 components/script_bindings/webidls/SVGPathElement.webidl create mode 100644 components/script_bindings/webidls/SVGPolygonElement.webidl create mode 100644 components/script_bindings/webidls/SVGPolylineElement.webidl create mode 100644 components/script_bindings/webidls/SVGRadialGradientElement.webidl create mode 100644 components/script_bindings/webidls/SVGRectElement.webidl create mode 100644 components/script_bindings/webidls/SVGStopElement.webidl create mode 100644 components/script_bindings/webidls/SVGSymbolElement.webidl create mode 100644 components/script_bindings/webidls/SVGUseElement.webidl delete mode 100644 tests/wpt/meta/fullscreen/api/element-request-fullscreen-svg-rect.html.ini create mode 100644 tests/wpt/meta/svg/animations/spaces-at-end-of-path-data.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-same-origin-frame.tentative.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame.tentative.sub.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-navigation-in-srcdoc-frame.tentative.sub.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-reload-as-sandbox.tentative.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-sandbox-frame.tentative.https.html.ini delete mode 100644 tests/wpt/meta/svg/styling/svg-filter-render-web-plugin.tentative.https.html.ini diff --git a/Cargo.lock b/Cargo.lock index 24059992eab8f..294d33b24c200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7573,7 +7573,7 @@ dependencies = [ [[package]] name = "selectors" version = "0.39.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "bitflags 2.13.0", "cssparser", @@ -9334,7 +9334,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.4.3" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "serde", "stable_deref_trait", @@ -9833,7 +9833,7 @@ dependencies = [ [[package]] name = "stylo" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "app_units", "arrayvec", @@ -9889,7 +9889,7 @@ dependencies = [ [[package]] name = "stylo_atoms" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "string_cache", "string_cache_codegen", @@ -9898,7 +9898,7 @@ dependencies = [ [[package]] name = "stylo_derive" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "darling", "proc-macro2", @@ -9910,7 +9910,7 @@ dependencies = [ [[package]] name = "stylo_dom" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "bitflags 2.13.0", "stylo_malloc_size_of", @@ -9919,7 +9919,7 @@ dependencies = [ [[package]] name = "stylo_malloc_size_of" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "app_units", "cssparser", @@ -9936,7 +9936,7 @@ dependencies = [ [[package]] name = "stylo_static_prefs" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "toml", ] @@ -9944,7 +9944,7 @@ dependencies = [ [[package]] name = "stylo_traits" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "app_units", "bitflags 2.13.0", @@ -10363,7 +10363,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "to_shmem" version = "0.5.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "cssparser", "servo_arc", @@ -10376,7 +10376,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.1.0" -source = "git+https://github.com/servo/stylo?rev=a64923b5d5c67313c81c5056f5e30ec0babb04d6#a64923b5d5c67313c81c5056f5e30ec0babb04d6" +source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" dependencies = [ "darling", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 1ff47027c3ebd..e67f8fd9a8579 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -216,14 +216,14 @@ rustls-pki-types = "1.14" rustls-platform-verifier = "0.7.0" sea-query = { version = "1.0.1", default-features = false, features = ["backend-sqlite", "derive"] } sea-query-rusqlite = "0.8.0" -selectors = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } +selectors = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } seq-macro = "0.3.6" serde = "1.0.228" serde_bytes = "0.11" serde_core = "1.0.226" serde_json = "1.0" serde_test = "1.0" -servo_arc = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } +servo_arc = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } sha1 = "0.11" sha2 = "0.11" sha3 = "0.12" @@ -233,12 +233,12 @@ smallvec = { version = "1.15", features = ["serde", "union"] } speexdsp-resampler = "0.1.0" string_cache = "0.9" strum = { version = "0.28", features = ["derive"] } -stylo = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } -stylo_atoms = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } -stylo_dom = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } -stylo_malloc_size_of = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } -stylo_static_prefs = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } -stylo_traits = { git = "https://github.com/servo/stylo", rev = "a64923b5d5c67313c81c5056f5e30ec0babb04d6" } +stylo = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo_atoms = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo_dom = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo_malloc_size_of = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo_static_prefs = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo_traits = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } surfman = { version = "0.13.0", features = ["chains"] } swapper = "0.1" syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] } diff --git a/components/script/dom/element/create.rs b/components/script/dom/element/create.rs index 2d35545c42bb9..66800811881d1 100644 --- a/components/script/dom/element/create.rs +++ b/components/script/dom/element/create.rs @@ -86,9 +86,23 @@ use crate::dom::html::htmlunknownelement::HTMLUnknownElement; use crate::dom::html::htmlvideoelement::HTMLVideoElement; use crate::dom::html::input_element::HTMLInputElement; use crate::dom::htmlmarqueeelement::HTMLMarqueeElement; +use crate::dom::svg::svgcircleelement::SVGCircleElement; +use crate::dom::svg::svgdefselement::SVGDefsElement; use crate::dom::svg::svgelement::SVGElement; +use crate::dom::svg::svgellipseelement::SVGEllipseElement; +use crate::dom::svg::svggelement::SVGGElement; use crate::dom::svg::svgimageelement::SVGImageElement; +use crate::dom::svg::svglineargradientelement::SVGLinearGradientElement; +use crate::dom::svg::svglineelement::SVGLineElement; +use crate::dom::svg::svgpathelement::SVGPathElement; +use crate::dom::svg::svgpolygonelement::SVGPolygonElement; +use crate::dom::svg::svgpolylineelement::SVGPolylineElement; +use crate::dom::svg::svgradialgradientelement::SVGRadialGradientElement; +use crate::dom::svg::svgrectelement::SVGRectElement; +use crate::dom::svg::svgstopelement::SVGStopElement; use crate::dom::svg::svgsvgelement::SVGSVGElement; +use crate::dom::svg::svgsymbolelement::SVGSymbolElement; +use crate::dom::svg::svguseelement::SVGUseElement; use crate::realms::enter_auto_realm; use crate::script_thread::ScriptThread; @@ -109,8 +123,22 @@ fn create_svg_element( ); match name.local { + local_name!("circle") => make!(SVGCircleElement), + local_name!("defs") => make!(SVGDefsElement), + local_name!("ellipse") => make!(SVGEllipseElement), + local_name!("g") => make!(SVGGElement), local_name!("image") => make!(SVGImageElement), + local_name!("line") => make!(SVGLineElement), + local_name!("linearGradient") => make!(SVGLinearGradientElement), + local_name!("path") => make!(SVGPathElement), + local_name!("polygon") => make!(SVGPolygonElement), + local_name!("polyline") => make!(SVGPolylineElement), + local_name!("radialGradient") => make!(SVGRadialGradientElement), + local_name!("stop") => make!(SVGStopElement), + local_name!("rect") => make!(SVGRectElement), local_name!("svg") => make!(SVGSVGElement), + local_name!("symbol") => make!(SVGSymbolElement), + local_name!("use") => make!(SVGUseElement), _ => make!(SVGElement), } } diff --git a/components/script/dom/node/virtualmethods.rs b/components/script/dom/node/virtualmethods.rs index 39c150e99bf68..5cd8636506f7e 100644 --- a/components/script/dom/node/virtualmethods.rs +++ b/components/script/dom/node/virtualmethods.rs @@ -9,7 +9,8 @@ use style::attr::AttrValue; use crate::dom::bindings::inheritance::{ Castable, DocumentFragmentTypeId, ElementTypeId, HTMLElementTypeId, HTMLMediaElementTypeId, - NodeTypeId, SVGElementTypeId, SVGGraphicsElementTypeId, + NodeTypeId, SVGElementTypeId, SVGGeometryElementTypeId, SVGGradientElementTypeId, + SVGGraphicsElementTypeId, }; use crate::dom::bindings::str::DOMString; use crate::dom::document::Document; @@ -66,9 +67,23 @@ use crate::dom::node::{ BindContext, ChildrenMutation, CloneChildrenFlag, MoveContext, Node, UnbindContext, }; use crate::dom::shadowroot::ShadowRoot; +use crate::dom::svg::svgcircleelement::SVGCircleElement; +use crate::dom::svg::svgdefselement::SVGDefsElement; use crate::dom::svg::svgelement::SVGElement; +use crate::dom::svg::svgellipseelement::SVGEllipseElement; +use crate::dom::svg::svggelement::SVGGElement; use crate::dom::svg::svgimageelement::SVGImageElement; +use crate::dom::svg::svglineargradientelement::SVGLinearGradientElement; +use crate::dom::svg::svglineelement::SVGLineElement; +use crate::dom::svg::svgpathelement::SVGPathElement; +use crate::dom::svg::svgpolygonelement::SVGPolygonElement; +use crate::dom::svg::svgpolylineelement::SVGPolylineElement; +use crate::dom::svg::svgradialgradientelement::SVGRadialGradientElement; +use crate::dom::svg::svgrectelement::SVGRectElement; +use crate::dom::svg::svgstopelement::SVGStopElement; use crate::dom::svg::svgsvgelement::SVGSVGElement; +use crate::dom::svg::svgsymbolelement::SVGSymbolElement; +use crate::dom::svg::svguseelement::SVGUseElement; /// Trait to allow DOM nodes to opt-in to overriding (or adding to) common /// behaviours. Replicates the effect of C++ virtual methods. @@ -338,12 +353,62 @@ pub(crate) fn vtable_for(node: &Node) -> &dyn VirtualMethods { NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTrackElement)) => { node.downcast::().unwrap() as &dyn VirtualMethods }, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement( + SVGGeometryElementTypeId::SVGCircleElement, + ), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement( + SVGGeometryElementTypeId::SVGEllipseElement, + ), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( SVGGraphicsElementTypeId::SVGImageElement, ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement(SVGGeometryElementTypeId::SVGRectElement), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement(SVGGeometryElementTypeId::SVGLineElement), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement( + SVGGeometryElementTypeId::SVGPolylineElement, + ), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement( + SVGGeometryElementTypeId::SVGPolygonElement, + ), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGeometryElement(SVGGeometryElementTypeId::SVGPathElement), + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( SVGGraphicsElementTypeId::SVGSVGElement, ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGGElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGUseElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGSymbolElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement( + SVGGraphicsElementTypeId::SVGDefsElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGradientElement( + SVGGradientElementTypeId::SVGLinearGradientElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGradientElement( + SVGGradientElementTypeId::SVGRadialGradientElement, + ))) => node.downcast::().unwrap() as &dyn VirtualMethods, + NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGStopElement)) => { + node.downcast::().unwrap() as &dyn VirtualMethods + }, NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGElement)) => { node.downcast::().unwrap() as &dyn VirtualMethods }, diff --git a/components/script/dom/svg/mod.rs b/components/script/dom/svg/mod.rs index fea175b775175..870a97b890c2d 100644 --- a/components/script/dom/svg/mod.rs +++ b/components/script/dom/svg/mod.rs @@ -2,7 +2,23 @@ * 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/. */ +pub(crate) mod svgcircleelement; +pub(crate) mod svgdefselement; pub(crate) mod svgelement; +pub(crate) mod svgellipseelement; +pub(crate) mod svggelement; +pub(crate) mod svggeometryelement; +pub(crate) mod svggradientelement; pub(crate) mod svggraphicselement; pub(crate) mod svgimageelement; +pub(crate) mod svglineargradientelement; +pub(crate) mod svglineelement; +pub(crate) mod svgpathelement; +pub(crate) mod svgpolygonelement; +pub(crate) mod svgpolylineelement; +pub(crate) mod svgradialgradientelement; +pub(crate) mod svgrectelement; +pub(crate) mod svgstopelement; pub(crate) mod svgsvgelement; +pub(crate) mod svgsymbolelement; +pub(crate) mod svguseelement; diff --git a/components/script/dom/svg/svgcircleelement.rs b/components/script/dom/svg/svgcircleelement.rs new file mode 100644 index 0000000000000..920d171d35b5f --- /dev/null +++ b/components/script/dom/svg/svgcircleelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGCircleElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGCircleElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGCircleElement { + SVGCircleElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGCircleElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGCircleElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgdefselement.rs b/components/script/dom/svg/svgdefselement.rs new file mode 100644 index 0000000000000..952bf208f0501 --- /dev/null +++ b/components/script/dom/svg/svgdefselement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggraphicselement::SVGGraphicsElement; + +#[dom_struct] +pub(crate) struct SVGDefsElement { + svggraphicselement: SVGGraphicsElement, +} + +impl SVGDefsElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGDefsElement { + SVGDefsElement { + svggraphicselement: SVGGraphicsElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGDefsElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGDefsElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgelement.rs b/components/script/dom/svg/svgelement.rs index 26daa0b19947e..5c0cfd5aaf854 100644 --- a/components/script/dom/svg/svgelement.rs +++ b/components/script/dom/svg/svgelement.rs @@ -32,6 +32,11 @@ use crate::dom::element::{AttributeMutation, Element}; use crate::dom::node::virtualmethods::VirtualMethods; use crate::dom::node::{Node, NodeTraits}; use crate::dom::scrolling_box::{ScrollAxisState, ScrollRequirement}; +use crate::dom::svg::svgcircleelement::SVGCircleElement; +use crate::dom::svg::svgellipseelement::SVGEllipseElement; +use crate::dom::svg::svgimageelement::SVGImageElement; +use crate::dom::svg::svgpathelement::SVGPathElement; +use crate::dom::svg::svgrectelement::SVGRectElement; use crate::dom::svg::svgsvgelement::SVGSVGElement; #[dom_struct] @@ -122,7 +127,20 @@ impl VirtualMethods for SVGElement { &local_name!("stroke-dasharray") | &local_name!("stroke-dashoffset") | &local_name!("stroke-miterlimit") | - &local_name!("stroke-opacity") + &local_name!("stroke-opacity") | + &local_name!("display") | + &local_name!("visibility") | + &local_name!("opacity") | + &local_name!("cx") | + &local_name!("cy") | + &local_name!("r") | + &local_name!("rx") | + &local_name!("ry") | + &local_name!("x") | + &local_name!("y") | + &local_name!("width") | + &local_name!("height") | + &local_name!("d") ) || self .super_type() .unwrap() @@ -339,6 +357,101 @@ impl<'dom> LayoutDom<'dom, SVGElement> { longhands::stroke_opacity::parse_declared, push, ); + self.parse_svg_attribute( + &parser_context, + "display", + longhands::display::parse_declared, + push, + ); + self.parse_svg_attribute( + &parser_context, + "visibility", + longhands::visibility::parse_declared, + push, + ); + self.parse_svg_attribute( + &parser_context, + "opacity", + longhands::opacity::parse_declared, + push, + ); + + // Parse geometry attributes based on element type + // : https://svgwg.org/svg2-draft/shapes.html#CircleElement + if element.downcast::().is_some() { + self.parse_svg_attribute(&parser_context, "cx", longhands::cx::parse_declared, push); + self.parse_svg_attribute(&parser_context, "cy", longhands::cy::parse_declared, push); + self.parse_svg_attribute(&parser_context, "r", longhands::r::parse_declared, push); + } + // : https://svgwg.org/svg2-draft/shapes.html#EllipseElement + if element.downcast::().is_some() { + self.parse_svg_attribute(&parser_context, "cx", longhands::cx::parse_declared, push); + self.parse_svg_attribute(&parser_context, "cy", longhands::cy::parse_declared, push); + self.parse_svg_attribute(&parser_context, "rx", longhands::rx::parse_declared, push); + self.parse_svg_attribute(&parser_context, "ry", longhands::ry::parse_declared, push); + } + // : https://svgwg.org/svg2-draft/shapes.html#RectElement + if element.downcast::().is_some() { + self.parse_svg_attribute(&parser_context, "x", longhands::x::parse_declared, push); + self.parse_svg_attribute(&parser_context, "y", longhands::y::parse_declared, push); + self.parse_svg_attribute( + &parser_context, + "width", + longhands::width::parse_declared, + push, + ); + self.parse_svg_attribute( + &parser_context, + "height", + longhands::height::parse_declared, + push, + ); + self.parse_svg_attribute(&parser_context, "rx", longhands::rx::parse_declared, push); + self.parse_svg_attribute(&parser_context, "ry", longhands::ry::parse_declared, push); + } + // : https://svgwg.org/svg2-draft/embedded.html#ImageElement + if element.downcast::().is_some() { + self.parse_svg_attribute(&parser_context, "x", longhands::x::parse_declared, push); + self.parse_svg_attribute(&parser_context, "y", longhands::y::parse_declared, push); + self.parse_svg_attribute( + &parser_context, + "width", + longhands::width::parse_declared, + push, + ); + self.parse_svg_attribute( + &parser_context, + "height", + longhands::height::parse_declared, + push, + ); + } + // : https://svgwg.org/svg2-draft/paths.html#PathElement + if element.downcast::().is_some() { + // The d CSS property only accepts `none` or `path()`, + // but the SVG presentation attribute uses raw path data (e.g. "M0,0 L1,1"). + // Wrap the raw path data in `path("...")` so the CSS parser can handle it. + if let Some(value) = element.get_attr_val_for_layout(&ns!(), &local_name!("d")) { + if value.eq_ignore_ascii_case("none") { + let mut input = cssparser::ParserInput::new(value); + let mut parser = cssparser::Parser::new(&mut input); + if let Ok(property) = + parser.parse_entirely(|i| longhands::d::parse_declared(&parser_context, i)) + { + push(property); + } + } else { + let wrapped = format!("path(\"{}\")", value); + let mut input = cssparser::ParserInput::new(&wrapped); + let mut parser = cssparser::Parser::new(&mut input); + if let Ok(property) = parser.parse_entirely(|parse_input| { + longhands::d::parse_declared(&parser_context, parse_input) + }) { + push(property); + } + } + } + } } fn parse_svg_attribute( diff --git a/components/script/dom/svg/svgellipseelement.rs b/components/script/dom/svg/svgellipseelement.rs new file mode 100644 index 0000000000000..1b5ff3c9d0007 --- /dev/null +++ b/components/script/dom/svg/svgellipseelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGEllipseElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGEllipseElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGEllipseElement { + SVGEllipseElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGEllipseElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGEllipseElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svggelement.rs b/components/script/dom/svg/svggelement.rs new file mode 100644 index 0000000000000..dfcdc332a5da3 --- /dev/null +++ b/components/script/dom/svg/svggelement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggraphicselement::SVGGraphicsElement; + +#[dom_struct] +pub(crate) struct SVGGElement { + svggraphicselement: SVGGraphicsElement, +} + +impl SVGGElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGGElement { + SVGGElement { + svggraphicselement: SVGGraphicsElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGGElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGGElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svggeometryelement.rs b/components/script/dom/svg/svggeometryelement.rs new file mode 100644 index 0000000000000..c3d5e604d3369 --- /dev/null +++ b/components/script/dom/svg/svggeometryelement.rs @@ -0,0 +1,51 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use stylo_dom::ElementState; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::document::Document; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggraphicselement::SVGGraphicsElement; + +#[dom_struct] +pub(crate) struct SVGGeometryElement { + svggraphicselement: SVGGraphicsElement, +} + +impl SVGGeometryElement { + pub(crate) fn new_inherited( + tag_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGGeometryElement { + SVGGeometryElement::new_inherited_with_state( + ElementState::empty(), + tag_name, + prefix, + document, + ) + } + + pub(crate) fn new_inherited_with_state( + state: ElementState, + tag_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGGeometryElement { + SVGGeometryElement { + svggraphicselement: SVGGraphicsElement::new_inherited_with_state( + state, tag_name, prefix, document, + ), + } + } +} + +impl VirtualMethods for SVGGeometryElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svggradientelement.rs b/components/script/dom/svg/svggradientelement.rs new file mode 100644 index 0000000000000..7c92971dbc6ab --- /dev/null +++ b/components/script/dom/svg/svggradientelement.rs @@ -0,0 +1,49 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use stylo_dom::ElementState; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::document::Document; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svgelement::SVGElement; + +#[dom_struct] +pub(crate) struct SVGGradientElement { + svgelement: SVGElement, +} + +impl SVGGradientElement { + pub(crate) fn new_inherited( + tag_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGGradientElement { + SVGGradientElement::new_inherited_with_state( + ElementState::empty(), + tag_name, + prefix, + document, + ) + } + + pub(crate) fn new_inherited_with_state( + state: ElementState, + tag_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGGradientElement { + SVGGradientElement { + svgelement: SVGElement::new_inherited_with_state(state, tag_name, prefix, document), + } + } +} + +impl VirtualMethods for SVGGradientElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svglineargradientelement.rs b/components/script/dom/svg/svglineargradientelement.rs new file mode 100644 index 0000000000000..5275f442ae9d2 --- /dev/null +++ b/components/script/dom/svg/svglineargradientelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggradientelement::SVGGradientElement; + +#[dom_struct] +pub(crate) struct SVGLinearGradientElement { + svggradientelement: SVGGradientElement, +} + +impl SVGLinearGradientElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGLinearGradientElement { + SVGLinearGradientElement { + svggradientelement: SVGGradientElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGLinearGradientElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGLinearGradientElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svglineelement.rs b/components/script/dom/svg/svglineelement.rs new file mode 100644 index 0000000000000..f352489886157 --- /dev/null +++ b/components/script/dom/svg/svglineelement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGLineElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGLineElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGLineElement { + SVGLineElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGLineElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGLineElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgpathelement.rs b/components/script/dom/svg/svgpathelement.rs new file mode 100644 index 0000000000000..fff551637a98f --- /dev/null +++ b/components/script/dom/svg/svgpathelement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGPathElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGPathElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGPathElement { + SVGPathElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGPathElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGPathElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgpolygonelement.rs b/components/script/dom/svg/svgpolygonelement.rs new file mode 100644 index 0000000000000..c6c74d519d018 --- /dev/null +++ b/components/script/dom/svg/svgpolygonelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGPolygonElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGPolygonElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGPolygonElement { + SVGPolygonElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGPolygonElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGPolygonElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgpolylineelement.rs b/components/script/dom/svg/svgpolylineelement.rs new file mode 100644 index 0000000000000..fc177717eb2ff --- /dev/null +++ b/components/script/dom/svg/svgpolylineelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGPolylineElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGPolylineElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGPolylineElement { + SVGPolylineElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGPolylineElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGPolylineElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgradialgradientelement.rs b/components/script/dom/svg/svgradialgradientelement.rs new file mode 100644 index 0000000000000..6f601485f5973 --- /dev/null +++ b/components/script/dom/svg/svgradialgradientelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggradientelement::SVGGradientElement; + +#[dom_struct] +pub(crate) struct SVGRadialGradientElement { + svggradientelement: SVGGradientElement, +} + +impl SVGRadialGradientElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGRadialGradientElement { + SVGRadialGradientElement { + svggradientelement: SVGGradientElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGRadialGradientElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGRadialGradientElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgrectelement.rs b/components/script/dom/svg/svgrectelement.rs new file mode 100644 index 0000000000000..ff19554437555 --- /dev/null +++ b/components/script/dom/svg/svgrectelement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggeometryelement::SVGGeometryElement; + +#[dom_struct] +pub(crate) struct SVGRectElement { + svggeometryelement: SVGGeometryElement, +} + +impl SVGRectElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGRectElement { + SVGRectElement { + svggeometryelement: SVGGeometryElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGRectElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGRectElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgstopelement.rs b/components/script/dom/svg/svgstopelement.rs new file mode 100644 index 0000000000000..8ee737eda6696 --- /dev/null +++ b/components/script/dom/svg/svgstopelement.rs @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; +use stylo_dom::ElementState; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svgelement::SVGElement; + +#[dom_struct] +pub(crate) struct SVGStopElement { + svgelement: SVGElement, +} + +impl SVGStopElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGStopElement { + SVGStopElement { + svgelement: SVGElement::new_inherited_with_state( + ElementState::empty(), + local_name, + prefix, + document, + ), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGStopElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGStopElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svgsymbolelement.rs b/components/script/dom/svg/svgsymbolelement.rs new file mode 100644 index 0000000000000..f635c7534bd2a --- /dev/null +++ b/components/script/dom/svg/svgsymbolelement.rs @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggraphicselement::SVGGraphicsElement; + +#[dom_struct] +pub(crate) struct SVGSymbolElement { + svggraphicselement: SVGGraphicsElement, +} + +impl SVGSymbolElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGSymbolElement { + SVGSymbolElement { + svggraphicselement: SVGGraphicsElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGSymbolElement::new_inherited( + local_name, prefix, document, + )), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGSymbolElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script/dom/svg/svguseelement.rs b/components/script/dom/svg/svguseelement.rs new file mode 100644 index 0000000000000..5f39e8a3ffe04 --- /dev/null +++ b/components/script/dom/svg/svguseelement.rs @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 dom_struct::dom_struct; +use html5ever::{LocalName, Prefix}; +use js::rust::HandleObject; + +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::root::DomRoot; +use crate::dom::document::Document; +use crate::dom::node::Node; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::svg::svggraphicselement::SVGGraphicsElement; + +#[dom_struct] +pub(crate) struct SVGUseElement { + svggraphicselement: SVGGraphicsElement, +} + +impl SVGUseElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> SVGUseElement { + SVGUseElement { + svggraphicselement: SVGGraphicsElement::new_inherited(local_name, prefix, document), + } + } + + pub(crate) fn new( + cx: &mut js::context::JSContext, + local_name: LocalName, + prefix: Option, + document: &Document, + proto: Option, + ) -> DomRoot { + Node::reflect_node_with_proto( + cx, + Box::new(SVGUseElement::new_inherited(local_name, prefix, document)), + document, + proto, + ) + } +} + +impl VirtualMethods for SVGUseElement { + fn super_type(&self) -> Option<&dyn VirtualMethods> { + Some(self.upcast::() as &dyn VirtualMethods) + } +} diff --git a/components/script_bindings/webidls/SVGCircleElement.webidl b/components/script_bindings/webidls/SVGCircleElement.webidl new file mode 100644 index 0000000000000..672e9730cb2cc --- /dev/null +++ b/components/script_bindings/webidls/SVGCircleElement.webidl @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGCircleElement +[Exposed=Window] +interface SVGCircleElement : SVGGeometryElement { + //[SameObject] readonly attribute SVGAnimatedLength cx; + //[SameObject] readonly attribute SVGAnimatedLength cy; + //[SameObject] readonly attribute SVGAnimatedLength r; +}; diff --git a/components/script_bindings/webidls/SVGDefsElement.webidl b/components/script_bindings/webidls/SVGDefsElement.webidl new file mode 100644 index 0000000000000..1e9204008266e --- /dev/null +++ b/components/script_bindings/webidls/SVGDefsElement.webidl @@ -0,0 +1,8 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGDefsElement +[Exposed=Window] +interface SVGDefsElement : SVGGraphicsElement { +}; diff --git a/components/script_bindings/webidls/SVGEllipseElement.webidl b/components/script_bindings/webidls/SVGEllipseElement.webidl new file mode 100644 index 0000000000000..f0454e15f81c7 --- /dev/null +++ b/components/script_bindings/webidls/SVGEllipseElement.webidl @@ -0,0 +1,12 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGEllipseElement +[Exposed=Window] +interface SVGEllipseElement : SVGGeometryElement { + //[SameObject] readonly attribute SVGAnimatedLength cx; + //[SameObject] readonly attribute SVGAnimatedLength cy; + //[SameObject] readonly attribute SVGAnimatedLength rx; + //[SameObject] readonly attribute SVGAnimatedLength ry; +}; diff --git a/components/script_bindings/webidls/SVGGElement.webidl b/components/script_bindings/webidls/SVGGElement.webidl new file mode 100644 index 0000000000000..0d49505d46567 --- /dev/null +++ b/components/script_bindings/webidls/SVGGElement.webidl @@ -0,0 +1,8 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGGElement +[Exposed=Window] +interface SVGGElement : SVGGraphicsElement { +}; diff --git a/components/script_bindings/webidls/SVGGeometryElement.webidl b/components/script_bindings/webidls/SVGGeometryElement.webidl new file mode 100644 index 0000000000000..75b53f476a511 --- /dev/null +++ b/components/script_bindings/webidls/SVGGeometryElement.webidl @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement +[Exposed=Window, Abstract] +interface SVGGeometryElement : SVGGraphicsElement { + //[SameObject] readonly attribute SVGAnimatedNumber pathLength; + + //boolean isPointInFill(optional DOMPointInit point = {}); + //boolean isPointInStroke(optional DOMPointInit point = {}); + //float getTotalLength(); + //DOMPoint getPointAtLength(float distance); +}; diff --git a/components/script_bindings/webidls/SVGGradientElement.webidl b/components/script_bindings/webidls/SVGGradientElement.webidl new file mode 100644 index 0000000000000..1998e8c05dbae --- /dev/null +++ b/components/script_bindings/webidls/SVGGradientElement.webidl @@ -0,0 +1,20 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGGradientElement +[Exposed=Window] +interface SVGGradientElement : SVGElement { + + // Spread Method Types + //const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0; + //const unsigned short SVG_SPREADMETHOD_PAD = 1; + //const unsigned short SVG_SPREADMETHOD_REFLECT = 2; + //const unsigned short SVG_SPREADMETHOD_REPEAT = 3; + + //[SameObject] readonly attribute SVGAnimatedEnumeration gradientUnits; + //[SameObject] readonly attribute SVGAnimatedTransformList gradientTransform; + //[SameObject] readonly attribute SVGAnimatedEnumeration spreadMethod; +}; + +//SVGGradientElement includes SVGURIReference; diff --git a/components/script_bindings/webidls/SVGLineElement.webidl b/components/script_bindings/webidls/SVGLineElement.webidl new file mode 100644 index 0000000000000..3a15acc7b0477 --- /dev/null +++ b/components/script_bindings/webidls/SVGLineElement.webidl @@ -0,0 +1,12 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGLineElement +[Exposed=Window] +interface SVGLineElement : SVGGeometryElement { + //[SameObject] readonly attribute SVGAnimatedLength x1; + //[SameObject] readonly attribute SVGAnimatedLength y1; + //[SameObject] readonly attribute SVGAnimatedLength x2; + //[SameObject] readonly attribute SVGAnimatedLength y2; +}; diff --git a/components/script_bindings/webidls/SVGLinearGradientElement.webidl b/components/script_bindings/webidls/SVGLinearGradientElement.webidl new file mode 100644 index 0000000000000..e713f3c66a53c --- /dev/null +++ b/components/script_bindings/webidls/SVGLinearGradientElement.webidl @@ -0,0 +1,12 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGLinearGradientElement +[Exposed=Window] +interface SVGLinearGradientElement : SVGGradientElement { + //[SameObject] readonly attribute SVGAnimatedLength x1; + //[SameObject] readonly attribute SVGAnimatedLength y1; + //[SameObject] readonly attribute SVGAnimatedLength x2; + //[SameObject] readonly attribute SVGAnimatedLength y2; +}; diff --git a/components/script_bindings/webidls/SVGPathElement.webidl b/components/script_bindings/webidls/SVGPathElement.webidl new file mode 100644 index 0000000000000..241589ec7a215 --- /dev/null +++ b/components/script_bindings/webidls/SVGPathElement.webidl @@ -0,0 +1,8 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/paths.html#InterfaceSVGPathElement +[Exposed=Window] +interface SVGPathElement : SVGGeometryElement { +}; diff --git a/components/script_bindings/webidls/SVGPolygonElement.webidl b/components/script_bindings/webidls/SVGPolygonElement.webidl new file mode 100644 index 0000000000000..acde9680aef4b --- /dev/null +++ b/components/script_bindings/webidls/SVGPolygonElement.webidl @@ -0,0 +1,10 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGPolygonElement +[Exposed=Window] +interface SVGPolygonElement : SVGGeometryElement { +}; + +// SVGPolygonElement includes SVGAnimatedPoints; diff --git a/components/script_bindings/webidls/SVGPolylineElement.webidl b/components/script_bindings/webidls/SVGPolylineElement.webidl new file mode 100644 index 0000000000000..8ef11ff71d71a --- /dev/null +++ b/components/script_bindings/webidls/SVGPolylineElement.webidl @@ -0,0 +1,10 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGPolylineElement +[Exposed=Window] +interface SVGPolylineElement : SVGGeometryElement { +}; + +// SVGPolylineElement includes SVGAnimatedPoints; diff --git a/components/script_bindings/webidls/SVGRadialGradientElement.webidl b/components/script_bindings/webidls/SVGRadialGradientElement.webidl new file mode 100644 index 0000000000000..82a85cb2e3124 --- /dev/null +++ b/components/script_bindings/webidls/SVGRadialGradientElement.webidl @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGRadialGradientElement +[Exposed=Window] +interface SVGRadialGradientElement : SVGGradientElement { + //[SameObject] readonly attribute SVGAnimatedLength cx; + //[SameObject] readonly attribute SVGAnimatedLength cy; + //[SameObject] readonly attribute SVGAnimatedLength r; + //[SameObject] readonly attribute SVGAnimatedLength fx; + //[SameObject] readonly attribute SVGAnimatedLength fy; + //[SameObject] readonly attribute SVGAnimatedLength fr; +}; diff --git a/components/script_bindings/webidls/SVGRectElement.webidl b/components/script_bindings/webidls/SVGRectElement.webidl new file mode 100644 index 0000000000000..e90bf3449421b --- /dev/null +++ b/components/script_bindings/webidls/SVGRectElement.webidl @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGRectElement +[Exposed=Window] +interface SVGRectElement : SVGGeometryElement { + //[SameObject] readonly attribute SVGAnimatedLength x; + //[SameObject] readonly attribute SVGAnimatedLength y; + //[SameObject] readonly attribute SVGAnimatedLength width; + //[SameObject] readonly attribute SVGAnimatedLength height; + //[SameObject] readonly attribute SVGAnimatedLength rx; + //[SameObject] readonly attribute SVGAnimatedLength ry; +}; diff --git a/components/script_bindings/webidls/SVGStopElement.webidl b/components/script_bindings/webidls/SVGStopElement.webidl new file mode 100644 index 0000000000000..38e040744e312 --- /dev/null +++ b/components/script_bindings/webidls/SVGStopElement.webidl @@ -0,0 +1,9 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGStopElement +[Exposed=Window] +interface SVGStopElement : SVGElement { + //[SameObject] readonly attribute SVGAnimatedNumber offset; +}; diff --git a/components/script_bindings/webidls/SVGSymbolElement.webidl b/components/script_bindings/webidls/SVGSymbolElement.webidl new file mode 100644 index 0000000000000..9218df2c6d1d3 --- /dev/null +++ b/components/script_bindings/webidls/SVGSymbolElement.webidl @@ -0,0 +1,10 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSymbolElement +[Exposed=Window] +interface SVGSymbolElement : SVGGraphicsElement { +}; + +//SVGSymbolElement includes SVGFitToViewBox; diff --git a/components/script_bindings/webidls/SVGUseElement.webidl b/components/script_bindings/webidls/SVGUseElement.webidl new file mode 100644 index 0000000000000..0e7b45eef2c86 --- /dev/null +++ b/components/script_bindings/webidls/SVGUseElement.webidl @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGUseElement +[Exposed=Window] +interface SVGUseElement : SVGGraphicsElement { + //[SameObject] readonly attribute SVGAnimatedLength x; + //[SameObject] readonly attribute SVGAnimatedLength y; + //[SameObject] readonly attribute SVGAnimatedLength width; + //[SameObject] readonly attribute SVGAnimatedLength height; + //[SameObject] readonly attribute SVGElement? instanceRoot; + //[SameObject] readonly attribute SVGElement? animatedInstanceRoot; +}; + +//SVGUseElement includes SVGURIReference; diff --git a/tests/wpt/meta/fullscreen/api/element-request-fullscreen-svg-rect.html.ini b/tests/wpt/meta/fullscreen/api/element-request-fullscreen-svg-rect.html.ini deleted file mode 100644 index a038f67aae5b3..0000000000000 --- a/tests/wpt/meta/fullscreen/api/element-request-fullscreen-svg-rect.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[element-request-fullscreen-svg-rect.html] - [Element#requestFullscreen() for SVG rect element] - expected: FAIL diff --git a/tests/wpt/meta/svg/animations/spaces-at-end-of-path-data.html.ini b/tests/wpt/meta/svg/animations/spaces-at-end-of-path-data.html.ini new file mode 100644 index 0000000000000..7bb166d7d5be8 --- /dev/null +++ b/tests/wpt/meta/svg/animations/spaces-at-end-of-path-data.html.ini @@ -0,0 +1,3 @@ +[spaces-at-end-of-path-data.html] + [Allow trailing empty entry in value list] + expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/cx-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/cx-composition.html.ini index 421a7fff267d3..ab05ca5fa0b4e 100644 --- a/tests/wpt/meta/svg/geometry/animations/cx-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/cx-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/cy-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/cy-composition.html.ini index 796deec67f842..4187d35300f47 100644 --- a/tests/wpt/meta/svg/geometry/animations/cy-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/cy-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/r-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/r-composition.html.ini index c3c71de1a5dda..0583ab9b3d380 100644 --- a/tests/wpt/meta/svg/geometry/animations/r-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/r-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/rx-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/rx-composition.html.ini index 00088e0f1e5ac..e130e7dc22a94 100644 --- a/tests/wpt/meta/svg/geometry/animations/rx-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/rx-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/ry-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/ry-composition.html.ini index dcdb4e8e0285a..243368e30e852 100644 --- a/tests/wpt/meta/svg/geometry/animations/ry-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/ry-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/x-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/x-composition.html.ini index 201f0ff3e2847..4374e936a920a 100644 --- a/tests/wpt/meta/svg/geometry/animations/x-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/x-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/geometry/animations/y-composition.html.ini b/tests/wpt/meta/svg/geometry/animations/y-composition.html.ini index eb4c5dd118b2e..17ac541849443 100644 --- a/tests/wpt/meta/svg/geometry/animations/y-composition.html.ini +++ b/tests/wpt/meta/svg/geometry/animations/y-composition.html.ini @@ -68,9 +68,6 @@ [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (0.5) should be [175px\]] expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1) should be [200px\]] - expected: FAIL - [Compositing CSS Animations: property underlying [50px\] from add [100px\] to replace [200px\] at (1.5) should be [225px\]] expected: FAIL diff --git a/tests/wpt/meta/svg/historical.html.ini b/tests/wpt/meta/svg/historical.html.ini index 379bb1580b28e..65145d7bbacd6 100644 --- a/tests/wpt/meta/svg/historical.html.ini +++ b/tests/wpt/meta/svg/historical.html.ini @@ -20,9 +20,6 @@ [SVGFilterElement must not implement SVGUnitTypes] expected: FAIL - [SVGGradientElement must not implement SVGUnitTypes] - expected: FAIL - [SVGMaskElement must not implement SVGUnitTypes] expected: FAIL diff --git a/tests/wpt/meta/svg/idlharness.window.js.ini b/tests/wpt/meta/svg/idlharness.window.js.ini index e4f90cfe802f9..fd9c205be2ce3 100644 --- a/tests/wpt/meta/svg/idlharness.window.js.ini +++ b/tests/wpt/meta/svg/idlharness.window.js.ini @@ -26,24 +26,6 @@ [SVGGraphicsElement interface: attribute systemLanguage] expected: FAIL - [SVGGeometryElement interface: existence and properties of interface object] - expected: FAIL - - [SVGGeometryElement interface object length] - expected: FAIL - - [SVGGeometryElement interface object name] - expected: FAIL - - [SVGGeometryElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGGeometryElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGGeometryElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGGeometryElement interface: attribute pathLength] expected: FAIL @@ -1241,30 +1223,6 @@ [SVGElement interface: objects.svg must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGGElement interface: existence and properties of interface object] - expected: FAIL - - [SVGGElement interface object length] - expected: FAIL - - [SVGGElement interface object name] - expected: FAIL - - [SVGGElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGGElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGGElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - - [SVGGElement must be primary interface of objects.g] - expected: FAIL - - [Stringification of objects.g] - expected: FAIL - [SVGGraphicsElement interface: objects.g must inherit property "transform" with the proper type] expected: FAIL @@ -1295,30 +1253,6 @@ [SVGElement interface: objects.g must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGDefsElement interface: existence and properties of interface object] - expected: FAIL - - [SVGDefsElement interface object length] - expected: FAIL - - [SVGDefsElement interface object name] - expected: FAIL - - [SVGDefsElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGDefsElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGDefsElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - - [SVGDefsElement must be primary interface of objects.defs] - expected: FAIL - - [Stringification of objects.defs] - expected: FAIL - [SVGGraphicsElement interface: objects.defs must inherit property "transform" with the proper type] expected: FAIL @@ -1448,36 +1382,12 @@ [SVGElement interface: objects.title must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGSymbolElement interface: existence and properties of interface object] - expected: FAIL - - [SVGSymbolElement interface object length] - expected: FAIL - - [SVGSymbolElement interface object name] - expected: FAIL - - [SVGSymbolElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGSymbolElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGSymbolElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGSymbolElement interface: attribute viewBox] expected: FAIL [SVGSymbolElement interface: attribute preserveAspectRatio] expected: FAIL - [SVGSymbolElement must be primary interface of objects.symbol] - expected: FAIL - - [Stringification of objects.symbol] - expected: FAIL - [SVGSymbolElement interface: objects.symbol must inherit property "viewBox" with the proper type] expected: FAIL @@ -1514,24 +1424,6 @@ [SVGElement interface: objects.symbol must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGUseElement interface: existence and properties of interface object] - expected: FAIL - - [SVGUseElement interface object length] - expected: FAIL - - [SVGUseElement interface object name] - expected: FAIL - - [SVGUseElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGUseElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGUseElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGUseElement interface: attribute x] expected: FAIL @@ -1553,12 +1445,6 @@ [SVGUseElement interface: attribute href] expected: FAIL - [SVGUseElement must be primary interface of objects.use] - expected: FAIL - - [Stringification of objects.use] - expected: FAIL - [SVGUseElement interface: objects.use must inherit property "x" with the proper type] expected: FAIL @@ -2264,24 +2150,6 @@ [SVGAnimatedPreserveAspectRatio interface: objects.image.preserveAspectRatio must inherit property "animVal" with the proper type] expected: FAIL - [SVGRectElement interface: existence and properties of interface object] - expected: FAIL - - [SVGRectElement interface object length] - expected: FAIL - - [SVGRectElement interface object name] - expected: FAIL - - [SVGRectElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGRectElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGRectElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGRectElement interface: attribute x] expected: FAIL @@ -2300,12 +2168,6 @@ [SVGRectElement interface: attribute ry] expected: FAIL - [SVGRectElement must be primary interface of objects.rect] - expected: FAIL - - [Stringification of objects.rect] - expected: FAIL - [SVGRectElement interface: objects.rect must inherit property "x" with the proper type] expected: FAIL @@ -2378,24 +2240,6 @@ [SVGElement interface: objects.rect must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGCircleElement interface: existence and properties of interface object] - expected: FAIL - - [SVGCircleElement interface object length] - expected: FAIL - - [SVGCircleElement interface object name] - expected: FAIL - - [SVGCircleElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGCircleElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGCircleElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGCircleElement interface: attribute cx] expected: FAIL @@ -2405,12 +2249,6 @@ [SVGCircleElement interface: attribute r] expected: FAIL - [SVGCircleElement must be primary interface of objects.circle] - expected: FAIL - - [Stringification of objects.circle] - expected: FAIL - [SVGCircleElement interface: objects.circle must inherit property "cx" with the proper type] expected: FAIL @@ -2474,24 +2312,6 @@ [SVGElement interface: objects.circle must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGEllipseElement interface: existence and properties of interface object] - expected: FAIL - - [SVGEllipseElement interface object length] - expected: FAIL - - [SVGEllipseElement interface object name] - expected: FAIL - - [SVGEllipseElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGEllipseElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGEllipseElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGEllipseElement interface: attribute cx] expected: FAIL @@ -2504,12 +2324,6 @@ [SVGEllipseElement interface: attribute ry] expected: FAIL - [SVGEllipseElement must be primary interface of objects.ellipse] - expected: FAIL - - [Stringification of objects.ellipse] - expected: FAIL - [SVGEllipseElement interface: objects.ellipse must inherit property "cx" with the proper type] expected: FAIL @@ -2576,24 +2390,6 @@ [SVGElement interface: objects.ellipse must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGLineElement interface: existence and properties of interface object] - expected: FAIL - - [SVGLineElement interface object length] - expected: FAIL - - [SVGLineElement interface object name] - expected: FAIL - - [SVGLineElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGLineElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGLineElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGLineElement interface: attribute x1] expected: FAIL @@ -2606,12 +2402,6 @@ [SVGLineElement interface: attribute y2] expected: FAIL - [SVGLineElement must be primary interface of objects.line] - expected: FAIL - - [Stringification of objects.line] - expected: FAIL - [SVGLineElement interface: objects.line must inherit property "x1" with the proper type] expected: FAIL @@ -2774,36 +2564,12 @@ [SVGPointList interface: calling appendItem(DOMPoint) on objects.polygon.points with too few arguments must throw TypeError] expected: FAIL - [SVGPolylineElement interface: existence and properties of interface object] - expected: FAIL - - [SVGPolylineElement interface object length] - expected: FAIL - - [SVGPolylineElement interface object name] - expected: FAIL - - [SVGPolylineElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGPolylineElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGPolylineElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGPolylineElement interface: attribute points] expected: FAIL [SVGPolylineElement interface: attribute animatedPoints] expected: FAIL - [SVGPolylineElement must be primary interface of objects.polyline] - expected: FAIL - - [Stringification of objects.polyline] - expected: FAIL - [SVGPolylineElement interface: objects.polyline must inherit property "points" with the proper type] expected: FAIL @@ -2864,36 +2630,12 @@ [SVGElement interface: objects.polyline must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGPolygonElement interface: existence and properties of interface object] - expected: FAIL - - [SVGPolygonElement interface object length] - expected: FAIL - - [SVGPolygonElement interface object name] - expected: FAIL - - [SVGPolygonElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGPolygonElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGPolygonElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGPolygonElement interface: attribute points] expected: FAIL [SVGPolygonElement interface: attribute animatedPoints] expected: FAIL - [SVGPolygonElement must be primary interface of objects.polygon] - expected: FAIL - - [Stringification of objects.polygon] - expected: FAIL - [SVGPolygonElement interface: objects.polygon must inherit property "points" with the proper type] expected: FAIL @@ -3836,24 +3578,6 @@ [SVGElement interface: objects.marker must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGGradientElement interface: existence and properties of interface object] - expected: FAIL - - [SVGGradientElement interface object length] - expected: FAIL - - [SVGGradientElement interface object name] - expected: FAIL - - [SVGGradientElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGGradientElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGGradientElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGGradientElement interface: constant SVG_SPREADMETHOD_UNKNOWN on interface object] expected: FAIL @@ -3890,24 +3614,6 @@ [SVGGradientElement interface: attribute href] expected: FAIL - [SVGLinearGradientElement interface: existence and properties of interface object] - expected: FAIL - - [SVGLinearGradientElement interface object length] - expected: FAIL - - [SVGLinearGradientElement interface object name] - expected: FAIL - - [SVGLinearGradientElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGLinearGradientElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGLinearGradientElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGLinearGradientElement interface: attribute x1] expected: FAIL @@ -3920,12 +3626,6 @@ [SVGLinearGradientElement interface: attribute y2] expected: FAIL - [SVGLinearGradientElement must be primary interface of objects.linearGradient] - expected: FAIL - - [Stringification of objects.linearGradient] - expected: FAIL - [SVGLinearGradientElement interface: objects.linearGradient must inherit property "x1" with the proper type] expected: FAIL @@ -3971,24 +3671,6 @@ [SVGElement interface: objects.linearGradient must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGRadialGradientElement interface: existence and properties of interface object] - expected: FAIL - - [SVGRadialGradientElement interface object length] - expected: FAIL - - [SVGRadialGradientElement interface object name] - expected: FAIL - - [SVGRadialGradientElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGRadialGradientElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGRadialGradientElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGRadialGradientElement interface: attribute cx] expected: FAIL @@ -4007,12 +3689,6 @@ [SVGRadialGradientElement interface: attribute fr] expected: FAIL - [SVGRadialGradientElement must be primary interface of objects.radialGradient] - expected: FAIL - - [Stringification of objects.radialGradient] - expected: FAIL - [SVGRadialGradientElement interface: objects.radialGradient must inherit property "cx" with the proper type] expected: FAIL @@ -4064,33 +3740,9 @@ [SVGElement interface: objects.radialGradient must inherit property "viewportElement" with the proper type] expected: FAIL - [SVGStopElement interface: existence and properties of interface object] - expected: FAIL - - [SVGStopElement interface object length] - expected: FAIL - - [SVGStopElement interface object name] - expected: FAIL - - [SVGStopElement interface: existence and properties of interface prototype object] - expected: FAIL - - [SVGStopElement interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [SVGStopElement interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [SVGStopElement interface: attribute offset] expected: FAIL - [SVGStopElement must be primary interface of objects.stop] - expected: FAIL - - [Stringification of objects.stop] - expected: FAIL - [SVGStopElement interface: objects.stop must inherit property "offset" with the proper type] expected: FAIL diff --git a/tests/wpt/meta/svg/styling/presentation-attributes-irrelevant.html.ini b/tests/wpt/meta/svg/styling/presentation-attributes-irrelevant.html.ini index 15b70786c7b8f..40f014f703343 100644 --- a/tests/wpt/meta/svg/styling/presentation-attributes-irrelevant.html.ini +++ b/tests/wpt/meta/svg/styling/presentation-attributes-irrelevant.html.ini @@ -11,9 +11,6 @@ [direction presentation attribute supported on an irrelevant element] expected: FAIL - [display presentation attribute supported on an irrelevant element] - expected: FAIL - [filter presentation attribute supported on an irrelevant element] expected: FAIL @@ -41,9 +38,6 @@ [letter-spacing presentation attribute supported on an irrelevant element] expected: FAIL - [opacity presentation attribute supported on an irrelevant element] - expected: FAIL - [overflow presentation attribute supported on an irrelevant element] expected: FAIL @@ -62,9 +56,6 @@ [unicode-bidi presentation attribute supported on an irrelevant element] expected: FAIL - [visibility presentation attribute supported on an irrelevant element] - expected: FAIL - [white-space presentation attribute supported on an irrelevant element] expected: FAIL diff --git a/tests/wpt/meta/svg/styling/presentation-attributes-relevant.html.ini b/tests/wpt/meta/svg/styling/presentation-attributes-relevant.html.ini index 62cfeae743d9f..58e114e6d6b23 100644 --- a/tests/wpt/meta/svg/styling/presentation-attributes-relevant.html.ini +++ b/tests/wpt/meta/svg/styling/presentation-attributes-relevant.html.ini @@ -11,9 +11,6 @@ [direction presentation attribute supported on a relevant element] expected: FAIL - [display presentation attribute supported on a relevant element] - expected: FAIL - [filter presentation attribute supported on a relevant element] expected: FAIL @@ -35,18 +32,12 @@ [font-weight presentation attribute supported on a relevant element] expected: FAIL - [height presentation attribute supported on a relevant element] - expected: FAIL - [image-rendering presentation attribute supported on a relevant element] expected: FAIL [letter-spacing presentation attribute supported on a relevant element] expected: FAIL - [opacity presentation attribute supported on a relevant element] - expected: FAIL - [overflow presentation attribute supported on a relevant element] expected: FAIL @@ -68,15 +59,9 @@ [unicode-bidi presentation attribute supported on a relevant element] expected: FAIL - [visibility presentation attribute supported on a relevant element] - expected: FAIL - [white-space presentation attribute supported on a relevant element] expected: FAIL - [width presentation attribute supported on a relevant element] - expected: FAIL - [word-spacing presentation attribute supported on a relevant element] expected: FAIL diff --git a/tests/wpt/meta/svg/styling/presentation-attributes-special-cases.html.ini b/tests/wpt/meta/svg/styling/presentation-attributes-special-cases.html.ini index fb1fe143b0261..77c667c2065d2 100644 --- a/tests/wpt/meta/svg/styling/presentation-attributes-special-cases.html.ini +++ b/tests/wpt/meta/svg/styling/presentation-attributes-special-cases.html.ini @@ -25,3 +25,6 @@ [fill presentation attribute not supported on set] expected: FAIL + + [x, y, width, and height presentation attributes supported on foreignObject element] + expected: FAIL diff --git a/tests/wpt/meta/svg/styling/presentation-attributes-unknown.html.ini b/tests/wpt/meta/svg/styling/presentation-attributes-unknown.html.ini index 35aa40eae937b..526aba7a7e32c 100644 --- a/tests/wpt/meta/svg/styling/presentation-attributes-unknown.html.ini +++ b/tests/wpt/meta/svg/styling/presentation-attributes-unknown.html.ini @@ -11,9 +11,6 @@ [direction presentation attribute supported on an unknown SVG element] expected: FAIL - [display presentation attribute supported on an unknown SVG element] - expected: FAIL - [filter presentation attribute supported on an unknown SVG element] expected: FAIL @@ -41,9 +38,6 @@ [letter-spacing presentation attribute supported on an unknown SVG element] expected: FAIL - [opacity presentation attribute supported on an unknown SVG element] - expected: FAIL - [overflow presentation attribute supported on an unknown SVG element] expected: FAIL @@ -62,9 +56,6 @@ [unicode-bidi presentation attribute supported on an unknown SVG element] expected: FAIL - [visibility presentation attribute supported on an unknown SVG element] - expected: FAIL - [white-space presentation attribute supported on an unknown SVG element] expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini deleted file mode 100644 index 541a03ba9727e..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-cross-origin-frame-in-cross-origin-frame.tentative.sub.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-same-origin-frame.tentative.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-same-origin-frame.tentative.https.html.ini deleted file mode 100644 index ac3409aa60ef3..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame-in-same-origin-frame.tentative.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-cross-origin-frame-in-same-origin-frame.tentative.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame.tentative.sub.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame.tentative.sub.https.html.ini deleted file mode 100644 index 02c8a9cdbdfb2..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-frame.tentative.sub.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-cross-origin-frame.tentative.sub.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-navigation-in-srcdoc-frame.tentative.sub.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-navigation-in-srcdoc-frame.tentative.sub.https.html.ini deleted file mode 100644 index f1225bd2db5ec..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-cross-origin-navigation-in-srcdoc-frame.tentative.sub.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-cross-origin-navigation-in-srcdoc-frame.tentative.sub.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini deleted file mode 100644 index e81e9ab0115c8..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-in-cross-origin-frame.tentative.sub.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-same-origin-frame-in-cross-origin-frame.tentative.sub.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-reload-as-sandbox.tentative.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-reload-as-sandbox.tentative.https.html.ini deleted file mode 100644 index e6977c04daa8b..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-same-origin-frame-reload-as-sandbox.tentative.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-same-origin-frame-reload-as-sandbox.tentative.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-sandbox-frame.tentative.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-sandbox-frame.tentative.https.html.ini deleted file mode 100644 index 89baae8d7d140..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-sandbox-frame.tentative.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-sandbox-frame.tentative.https.html] - expected: FAIL diff --git a/tests/wpt/meta/svg/styling/svg-filter-render-web-plugin.tentative.https.html.ini b/tests/wpt/meta/svg/styling/svg-filter-render-web-plugin.tentative.https.html.ini deleted file mode 100644 index ec84935e3fe92..0000000000000 --- a/tests/wpt/meta/svg/styling/svg-filter-render-web-plugin.tentative.https.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[svg-filter-render-web-plugin.tentative.https.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 602bb00f00902..4fb09c5faca6e 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -13029,7 +13029,7 @@ ] ], "css-property-listing.html": [ - "a6ead7a038470ec148a8c397ed4b55b0540da674", + "ebcd33fe2ac66d47d90076c550d6657cb7624afb", [ null, {} diff --git a/tests/wpt/mozilla/tests/css/css-property-listing.html b/tests/wpt/mozilla/tests/css/css-property-listing.html index a6ead7a038470..ebcd33fe2ac66 100644 --- a/tests/wpt/mozilla/tests/css/css-property-listing.html +++ b/tests/wpt/mozilla/tests/css/css-property-listing.html @@ -92,6 +92,9 @@ "container-type", "content", "cursor", + "cx", + "cy", + "d", "direction", "display", "empty-cells", @@ -193,9 +196,12 @@ "pointer-events", "position", "quotes", + "r", "right", "rotate", "row-gap", + "rx", + "ry", "scale", "stroke", "stroke-dasharray", @@ -235,6 +241,8 @@ "will-change", "word-break", "word-spacing", + "x", + "y", "z-index", "-webkit-text-security", ]; @@ -451,6 +459,14 @@ "min-width", "width", "clip-path", + "d", + "rx", + "ry", + "cx", + "cy", + "x", + "y", + "r", "table-layout", "text-decoration-line", "text-decoration-style", diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.https.html b/tests/wpt/mozilla/tests/mozilla/interfaces.https.html index f91a491abdf54..7347d3401c220 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.https.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.https.html @@ -343,13 +343,29 @@ "StyleSheetList", "SubmitEvent", "SubtleCrypto", + "SVGCircleElement", + "SVGDefsElement", "SVGElement", + "SVGEllipseElement", + "SVGGeometryElement", + "SVGGElement", + "SVGGradientElement", "SVGGraphicsElement", "SVGImageElement", + "SVGLinearGradientElement", + "SVGLineElement", "SVGMatrix", + "SVGPathElement", "SVGPoint", + "SVGPolygonElement", + "SVGPolylineElement", + "SVGRadialGradientElement", "SVGRect", + "SVGRectElement", + "SVGStopElement", "SVGSVGElement", + "SVGSymbolElement", + "SVGUseElement", "Text", "TextTrack", "TextTrackCue", From 44cc96b795cec030429dbbc47584129f13ff29fa Mon Sep 17 00:00:00 2001 From: Mohamed Mostafa Date: Thu, 16 Jul 2026 17:35:33 +0800 Subject: [PATCH 2/3] Update manifest Signed-off-by: Mohamed Mostafa --- tests/wpt/mozilla/meta/MANIFEST.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 4fb09c5faca6e..87a5260c837ef 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -14475,7 +14475,7 @@ ] ], "interfaces.https.html": [ - "f91a491abdf5414d1116ebc8b63c0010f7493a37", + "7347d3401c2202840644c2bd6de1492d68afcd2b", [ null, {} From dbf3783dbdc4f8a56621cec63efe8ffb7d6e3c63 Mon Sep 17 00:00:00 2001 From: Mohamed Mostafa Date: Thu, 16 Jul 2026 20:55:24 +0800 Subject: [PATCH 3/3] Update Stylo Signed-off-by: Mohamed Mostafa --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 294d33b24c200..7427b1b661a9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7573,7 +7573,7 @@ dependencies = [ [[package]] name = "selectors" version = "0.39.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "bitflags 2.13.0", "cssparser", @@ -9334,7 +9334,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.4.3" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "serde", "stable_deref_trait", @@ -9833,7 +9833,7 @@ dependencies = [ [[package]] name = "stylo" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "app_units", "arrayvec", @@ -9889,7 +9889,7 @@ dependencies = [ [[package]] name = "stylo_atoms" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "string_cache", "string_cache_codegen", @@ -9898,7 +9898,7 @@ dependencies = [ [[package]] name = "stylo_derive" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "darling", "proc-macro2", @@ -9910,7 +9910,7 @@ dependencies = [ [[package]] name = "stylo_dom" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "bitflags 2.13.0", "stylo_malloc_size_of", @@ -9919,7 +9919,7 @@ dependencies = [ [[package]] name = "stylo_malloc_size_of" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "app_units", "cssparser", @@ -9936,7 +9936,7 @@ dependencies = [ [[package]] name = "stylo_static_prefs" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "toml", ] @@ -9944,7 +9944,7 @@ dependencies = [ [[package]] name = "stylo_traits" version = "0.19.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "app_units", "bitflags 2.13.0", @@ -10363,7 +10363,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "to_shmem" version = "0.5.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "cssparser", "servo_arc", @@ -10376,7 +10376,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.1.0" -source = "git+https://github.com/servo/stylo?rev=refs%2Fpull%2F427%2Fhead#680d60fe5d9b32c219531e455a41213fa0291d03" +source = "git+https://github.com/servo/stylo?rev=5173fcd4455b99cc42777f81715a1bd68ed5b32c#5173fcd4455b99cc42777f81715a1bd68ed5b32c" dependencies = [ "darling", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index e67f8fd9a8579..e2d13f1ada7cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -216,14 +216,14 @@ rustls-pki-types = "1.14" rustls-platform-verifier = "0.7.0" sea-query = { version = "1.0.1", default-features = false, features = ["backend-sqlite", "derive"] } sea-query-rusqlite = "0.8.0" -selectors = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +selectors = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } seq-macro = "0.3.6" serde = "1.0.228" serde_bytes = "0.11" serde_core = "1.0.226" serde_json = "1.0" serde_test = "1.0" -servo_arc = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +servo_arc = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } sha1 = "0.11" sha2 = "0.11" sha3 = "0.12" @@ -233,12 +233,12 @@ smallvec = { version = "1.15", features = ["serde", "union"] } speexdsp-resampler = "0.1.0" string_cache = "0.9" strum = { version = "0.28", features = ["derive"] } -stylo = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } -stylo_atoms = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } -stylo_dom = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } -stylo_malloc_size_of = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } -stylo_static_prefs = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } -stylo_traits = { git = "https://github.com/servo/stylo", rev = "refs/pull/427/head" } +stylo = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } +stylo_atoms = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } +stylo_dom = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } +stylo_malloc_size_of = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } +stylo_static_prefs = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } +stylo_traits = { git = "https://github.com/servo/stylo", rev = "5173fcd4455b99cc42777f81715a1bd68ed5b32c" } surfman = { version = "0.13.0", features = ["chains"] } swapper = "0.1" syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }