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
This commit is contained in:
Robert Longson 2024-02-23 21:14:10 +00:00
parent 2b707407b5
commit 3087118fc8
11 changed files with 63 additions and 8 deletions

View File

@ -1,6 +1,5 @@
[idlharness.window.html] [idlharness.window.html]
prefs: [svg.SVGAElement.text.enabled:true] prefs: [svg.SVGAElement.text.enabled:true]
[SVGElement interface: attribute correspondingElement] [SVGElement interface: attribute correspondingElement]
expected: FAIL expected: FAIL
@ -441,3 +440,60 @@
[SVGDiscardElement interface: existence and properties of interface prototype object's @@unscopables property] [SVGDiscardElement interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL 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

View File

@ -29,9 +29,8 @@
} else { } else {
const namespaceURI = "http://www.w3.org/2000/svg"; const namespaceURI = "http://www.w3.org/2000/svg";
scriptElement = document.createElementNS(namespaceURI, "script"); scriptElement = document.createElementNS(namespaceURI, "script");
// Use setAttribute as SVGURIReference's href property is read-only scriptElement.href.baseVal = data.src;
// and SVGScriptElement has no fetchPriority property. // Use setAttribute as SVGScriptElement has no fetchPriority property.
scriptElement.setAttribute("href", data.src);
if ("fetchPriority" in data) { if ("fetchPriority" in data) {
scriptElement.setAttribute("fetchPriority", data.fetchPriority); scriptElement.setAttribute("fetchPriority", data.fetchPriority);
} }

View File

@ -30,8 +30,8 @@
} else { } else {
const namespaceURI = "http://www.w3.org/2000/svg"; const namespaceURI = "http://www.w3.org/2000/svg";
scriptElement = document.createElementNS(namespaceURI, "script"); scriptElement = document.createElementNS(namespaceURI, "script");
// Use setAttribute as SVGURIReference's href property is read-only scriptElement.href.baseVal = data.src;
// and SVGScriptElement has no fetchPriority property. // Use setAttribute as SVGScriptElement has no fetchPriority property.
scriptElement.setAttribute("href", data.src); scriptElement.setAttribute("href", data.src);
if ("fetchPriority" in data) { if ("fetchPriority" in data) {
scriptElement.setAttribute("fetchPriority", data.fetchPriority); scriptElement.setAttribute("fetchPriority", data.fetchPriority);

View File

@ -42,9 +42,9 @@ const elements = [
'script', 'script',
'animate', 'animate',
'set', 'set',
'discard',
'animateMotion', 'animateMotion',
'mpath', 'mpath',
'animateColor',
'animateTransform', 'animateTransform',
'metadata', 'metadata',
'foreignObject', 'foreignObject',
@ -167,10 +167,10 @@ idl_test(
SVGViewElement: ['objects.view'], SVGViewElement: ['objects.view'],
SVGScriptElement: ['objects.script'], SVGScriptElement: ['objects.script'],
SVGAnimateElement: ['objects.animate'], SVGAnimateElement: ['objects.animate'],
SVGDiscardElement: ['objects.discard'],
SVGSetElement: ['objects.set'], SVGSetElement: ['objects.set'],
SVGAnimateMotionElement: ['objects.animateMotion'], SVGAnimateMotionElement: ['objects.animateMotion'],
SVGMPathElement: ['objects.mpath'], SVGMPathElement: ['objects.mpath'],
SVGAnimateColorElement: ['objects.animateColor'],
SVGAnimateTransformElement: ['objects.animateTransform'], SVGAnimateTransformElement: ['objects.animateTransform'],
SVGMetadataElement: ['objects.metadata'], SVGMetadataElement: ['objects.metadata'],
SVGForeignObjectElement: ['objects.foreignObject'], SVGForeignObjectElement: ['objects.foreignObject'],

View File

Before

Width:  |  Height:  |  Size: 375 B

After

Width:  |  Height:  |  Size: 375 B

View File

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 670 B

View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B