From 913066d2e5db3b44f79f5258fe3708e768f1a43a Mon Sep 17 00:00:00 2001 From: lumiscosity Date: Thu, 21 Aug 2025 09:19:25 +0200 Subject: [PATCH] Add legacy window aliases `SVGMatrix`/`SVGPoint` for `DOMMatrix`/`DOMPoint` (#38810) Adds the legacy window aliases `SVGMatrix`/`SVGPoint` for `DOMMatrix`/`DOMPoint`. Testing: Covered by WPT (`css/geometry`). --------- Signed-off-by: lumiscosity --- components/script_bindings/webidls/DOMMatrix.webidl | 2 +- components/script_bindings/webidls/DOMPoint.webidl | 3 ++- tests/wpt/meta/css/geometry/idlharness.any.js.ini | 6 ------ tests/wpt/mozilla/meta/MANIFEST.json | 2 +- tests/wpt/mozilla/tests/mozilla/interfaces.https.html | 2 ++ 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/script_bindings/webidls/DOMMatrix.webidl b/components/script_bindings/webidls/DOMMatrix.webidl index e0518bce659..a6e4408994e 100644 --- a/components/script_bindings/webidls/DOMMatrix.webidl +++ b/components/script_bindings/webidls/DOMMatrix.webidl @@ -5,7 +5,7 @@ // https://drafts.fxtf.org/geometry/#dommatrix [Exposed=(Window,Worker,PaintWorklet), - LegacyWindowAlias=WebKitCSSMatrix] + LegacyWindowAlias=(SVGMatrix,WebKitCSSMatrix)] interface DOMMatrix : DOMMatrixReadOnly { [Throws] constructor(optional (DOMString or sequence) init); diff --git a/components/script_bindings/webidls/DOMPoint.webidl b/components/script_bindings/webidls/DOMPoint.webidl index 88127f6b015..df38c1a629d 100644 --- a/components/script_bindings/webidls/DOMPoint.webidl +++ b/components/script_bindings/webidls/DOMPoint.webidl @@ -11,7 +11,8 @@ // http://dev.w3.org/fxtf/geometry/Overview.html#dompoint [Exposed=(Window,Worker,PaintWorklet), - Serializable] + Serializable, + LegacyWindowAlias=SVGPoint] interface DOMPoint : DOMPointReadOnly { [Throws] constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double w = 1); diff --git a/tests/wpt/meta/css/geometry/idlharness.any.js.ini b/tests/wpt/meta/css/geometry/idlharness.any.js.ini index 24ca51dc0b5..38d53677fb8 100644 --- a/tests/wpt/meta/css/geometry/idlharness.any.js.ini +++ b/tests/wpt/meta/css/geometry/idlharness.any.js.ini @@ -10,9 +10,6 @@ [DOMMatrix interface: operation setMatrixValue(DOMString)] expected: FAIL - [DOMPoint interface: legacy window alias] - expected: FAIL - [DOMMatrix interface: calling setMatrixValue(DOMString) on new DOMMatrix() with too few arguments must throw TypeError] expected: FAIL @@ -25,9 +22,6 @@ [DOMRectList must be primary interface of [object DOMRect\]] expected: FAIL - [DOMMatrix interface: legacy window alias] - expected: FAIL - [Stringification of [object DOMRect\]] expected: FAIL diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 5fdb9942599..17d953609db 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -13725,7 +13725,7 @@ ] ], "interfaces.https.html": [ - "40567f81c201fe775ad4735c231349fac8c33381", + "a9447edae08028bd992e3aa7c9e7a2a483baa446", [ null, {} diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.https.html b/tests/wpt/mozilla/tests/mozilla/interfaces.https.html index 40567f81c20..a9447edae08 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.https.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.https.html @@ -320,6 +320,8 @@ test_interfaces([ "SVGElement", "SVGGraphicsElement", "SVGImageElement", + "SVGMatrix", + "SVGPoint", "SVGRect", "SVGSVGElement", "Text",