From 3087118fc8e59511f3278a327d4813fc1fa8ce9d Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Fri, 23 Feb 2024 21:14:10 +0000 Subject: [PATCH] Bug 1881754 - refactor some SVG web platform tests r=emilio - SVGAnimateColorElement is deprecated and should be removed where possible - SVGDiscardElement needs to be included correctly - svg/rendering is the correct directory per the SVG 2 specification and not svg/render - Move a styling test to the styling directory Differential Revision: https://phabricator.services.mozilla.com/D202593 --- .../meta/svg/idlharness.window.js.ini | 58 ++++++++++++++++++- .../order/z-index.svg.ini | 0 .../module-script-dynamic-insertion.h2.html | 5 +- .../script-dynamic-insertion.h2.html | 4 +- .../tests/svg/idlharness.window.js | 4 +- .../order/clip-path-filter-order-ref.svg | 0 .../order/clip-path-filter-order.svg | 0 .../order/z-index-ref.svg | 0 .../{rendering => render}/order/z-index.svg | 0 .../color-inherit-link-visited-ref.svg | 0 .../color-inherit-link-visited.svg | 0 11 files changed, 63 insertions(+), 8 deletions(-) rename testing/web-platform/meta/svg/{rendering => render}/order/z-index.svg.ini (100%) rename testing/web-platform/tests/svg/{rendering => render}/order/clip-path-filter-order-ref.svg (100%) rename testing/web-platform/tests/svg/{rendering => render}/order/clip-path-filter-order.svg (100%) rename testing/web-platform/tests/svg/{rendering => render}/order/z-index-ref.svg (100%) rename testing/web-platform/tests/svg/{rendering => render}/order/z-index.svg (100%) rename testing/web-platform/tests/svg/{ => styling}/color-inherit-link-visited-ref.svg (100%) rename testing/web-platform/tests/svg/{ => styling}/color-inherit-link-visited.svg (100%) diff --git a/testing/web-platform/meta/svg/idlharness.window.js.ini b/testing/web-platform/meta/svg/idlharness.window.js.ini index 7b28b44bf78d..2db0b04ed728 100644 --- a/testing/web-platform/meta/svg/idlharness.window.js.ini +++ b/testing/web-platform/meta/svg/idlharness.window.js.ini @@ -1,6 +1,5 @@ [idlharness.window.html] prefs: [svg.SVGAElement.text.enabled:true] - [SVGElement interface: attribute correspondingElement] expected: FAIL @@ -441,3 +440,60 @@ [SVGDiscardElement interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL + + [SVGDiscardElement must be primary interface of objects.discard] + expected: FAIL + + [Stringification of objects.discard] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "targetElement" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "onbegin" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "onend" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "onrepeat" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "getStartTime()" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "getCurrentTime()" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "getSimpleDuration()" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "beginElement()" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "beginElementAt(float)" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: calling beginElementAt(float) on objects.discard with too few arguments must throw TypeError] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "endElement()" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "endElementAt(float)" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: calling endElementAt(float) on objects.discard with too few arguments must throw TypeError] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "requiredExtensions" with the proper type] + expected: FAIL + + [SVGAnimationElement interface: objects.discard must inherit property "systemLanguage" with the proper type] + expected: FAIL + + [SVGElement interface: objects.discard must inherit property "correspondingElement" with the proper type] + expected: FAIL + + [SVGElement interface: objects.discard must inherit property "correspondingUseElement" with the proper type] + expected: FAIL diff --git a/testing/web-platform/meta/svg/rendering/order/z-index.svg.ini b/testing/web-platform/meta/svg/render/order/z-index.svg.ini similarity index 100% rename from testing/web-platform/meta/svg/rendering/order/z-index.svg.ini rename to testing/web-platform/meta/svg/render/order/z-index.svg.ini diff --git a/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/module-script-dynamic-insertion.h2.html b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/module-script-dynamic-insertion.h2.html index 4ef4dec251ff..572fe5ae7e19 100644 --- a/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/module-script-dynamic-insertion.h2.html +++ b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/module-script-dynamic-insertion.h2.html @@ -29,9 +29,8 @@ } else { const namespaceURI = "http://www.w3.org/2000/svg"; scriptElement = document.createElementNS(namespaceURI, "script"); - // Use setAttribute as SVGURIReference's href property is read-only - // and SVGScriptElement has no fetchPriority property. - scriptElement.setAttribute("href", data.src); + scriptElement.href.baseVal = data.src; + // Use setAttribute as SVGScriptElement has no fetchPriority property. if ("fetchPriority" in data) { scriptElement.setAttribute("fetchPriority", data.fetchPriority); } diff --git a/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/script-dynamic-insertion.h2.html b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/script-dynamic-insertion.h2.html index a65909d15193..8ed2ae7e01a9 100644 --- a/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/script-dynamic-insertion.h2.html +++ b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/script-tests/script-dynamic-insertion.h2.html @@ -30,8 +30,8 @@ } else { const namespaceURI = "http://www.w3.org/2000/svg"; scriptElement = document.createElementNS(namespaceURI, "script"); - // Use setAttribute as SVGURIReference's href property is read-only - // and SVGScriptElement has no fetchPriority property. + scriptElement.href.baseVal = data.src; + // Use setAttribute as SVGScriptElement has no fetchPriority property. scriptElement.setAttribute("href", data.src); if ("fetchPriority" in data) { scriptElement.setAttribute("fetchPriority", data.fetchPriority); diff --git a/testing/web-platform/tests/svg/idlharness.window.js b/testing/web-platform/tests/svg/idlharness.window.js index 04cf99729e42..a26fa2bef6d7 100644 --- a/testing/web-platform/tests/svg/idlharness.window.js +++ b/testing/web-platform/tests/svg/idlharness.window.js @@ -42,9 +42,9 @@ const elements = [ 'script', 'animate', 'set', + 'discard', 'animateMotion', 'mpath', - 'animateColor', 'animateTransform', 'metadata', 'foreignObject', @@ -167,10 +167,10 @@ idl_test( SVGViewElement: ['objects.view'], SVGScriptElement: ['objects.script'], SVGAnimateElement: ['objects.animate'], + SVGDiscardElement: ['objects.discard'], SVGSetElement: ['objects.set'], SVGAnimateMotionElement: ['objects.animateMotion'], SVGMPathElement: ['objects.mpath'], - SVGAnimateColorElement: ['objects.animateColor'], SVGAnimateTransformElement: ['objects.animateTransform'], SVGMetadataElement: ['objects.metadata'], SVGForeignObjectElement: ['objects.foreignObject'], diff --git a/testing/web-platform/tests/svg/rendering/order/clip-path-filter-order-ref.svg b/testing/web-platform/tests/svg/render/order/clip-path-filter-order-ref.svg similarity index 100% rename from testing/web-platform/tests/svg/rendering/order/clip-path-filter-order-ref.svg rename to testing/web-platform/tests/svg/render/order/clip-path-filter-order-ref.svg diff --git a/testing/web-platform/tests/svg/rendering/order/clip-path-filter-order.svg b/testing/web-platform/tests/svg/render/order/clip-path-filter-order.svg similarity index 100% rename from testing/web-platform/tests/svg/rendering/order/clip-path-filter-order.svg rename to testing/web-platform/tests/svg/render/order/clip-path-filter-order.svg diff --git a/testing/web-platform/tests/svg/rendering/order/z-index-ref.svg b/testing/web-platform/tests/svg/render/order/z-index-ref.svg similarity index 100% rename from testing/web-platform/tests/svg/rendering/order/z-index-ref.svg rename to testing/web-platform/tests/svg/render/order/z-index-ref.svg diff --git a/testing/web-platform/tests/svg/rendering/order/z-index.svg b/testing/web-platform/tests/svg/render/order/z-index.svg similarity index 100% rename from testing/web-platform/tests/svg/rendering/order/z-index.svg rename to testing/web-platform/tests/svg/render/order/z-index.svg diff --git a/testing/web-platform/tests/svg/color-inherit-link-visited-ref.svg b/testing/web-platform/tests/svg/styling/color-inherit-link-visited-ref.svg similarity index 100% rename from testing/web-platform/tests/svg/color-inherit-link-visited-ref.svg rename to testing/web-platform/tests/svg/styling/color-inherit-link-visited-ref.svg diff --git a/testing/web-platform/tests/svg/color-inherit-link-visited.svg b/testing/web-platform/tests/svg/styling/color-inherit-link-visited.svg similarity index 100% rename from testing/web-platform/tests/svg/color-inherit-link-visited.svg rename to testing/web-platform/tests/svg/styling/color-inherit-link-visited.svg