summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/struct/reftests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/svg/struct/reftests
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/svg/struct/reftests')
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/currentScale-change-repaint.html16
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/currentScale.svg11
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/nested-svg-through-display-contents.svg13
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.html2
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.svg3
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/requiredextensions-empty-string.svg6
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/requiredextensions-xhtml.tentative.svg12
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg5
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg.headers2
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/support/red-rect.svg3
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/support/sprites.svg3
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-a.svg12
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-adopted-with-external-resource.tentative.svg14
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-cross-origin.svg12
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-data-url.tentative.svg7
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-external-resource-with-revalidation.tentative.html36
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-inheritance-001.svg35
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-child-of.svg37
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-last-child-of.svg37
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-no-tspan.svg10
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-same-origin.svg6
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-001.svg18
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-002.svg18
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-switch.svg12
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-001.svg18
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-002.svg18
26 files changed, 366 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/struct/reftests/currentScale-change-repaint.html b/testing/web-platform/tests/svg/struct/reftests/currentScale-change-repaint.html
new file mode 100644
index 0000000000..aa3939c1be
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/currentScale-change-repaint.html
@@ -0,0 +1,16 @@
+<!doctype HTML>
+<meta charset="utf-8">
+<title>Testcase for changing currentScale on SVG embedded in HTML</title>
+<link rel="help" href="https://www.w3.org/TR/SVG/struct.html#__svg__SVGSVGElement__currentScale">
+<link rel="match" href="reference/green-100x100.html">
+<script>
+ function go() {
+ const mySVG = document.getElementById("mySVG");
+ mySVG.currentScale = 0.5;
+ }
+</script>
+<body onload="go()">
+ <svg id="mySVG">
+ <rect width="100" height="100" fill="green"></rect>
+ </svg>
+</body>
diff --git a/testing/web-platform/tests/svg/struct/reftests/currentScale.svg b/testing/web-platform/tests/svg/struct/reftests/currentScale.svg
new file mode 100644
index 0000000000..926117b6d5
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/currentScale.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" onload="scaleDown()">
+ <title>Testcase for changing currentScale on SVG embedded in HTML</title>
+ <h:link rel="help" href="https://www.w3.org/TR/SVG/struct.html#__svg__SVGSVGElement__currentScale"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <script>
+ function scaleDown() {
+ document.documentElement.currentScale = 0.5;
+ }
+ </script>
+ <rect width="200" height="200" fill="green"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/nested-svg-through-display-contents.svg b/testing/web-platform/tests/svg/struct/reftests/nested-svg-through-display-contents.svg
new file mode 100644
index 0000000000..1be64d5242
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/nested-svg-through-display-contents.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<svg viewBox="0 0 400 400" width="400" height="400" stroke="none" id="s1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml">
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#ForeignNamespaces"/>
+ <rect x="0" y="0" width="100" height="100" fill="green"></rect>
+ <h:div style="display: contents">
+ <svg width="300" height="300">
+ <rect x="5" y="5" width="100" height="100" fill="red"></rect>
+ </svg>
+ </h:div>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.html b/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.html
new file mode 100644
index 0000000000..f718ea6abf
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
diff --git a/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.svg b/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.svg
new file mode 100644
index 0000000000..120941444a
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/reference/green-100x100.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect width="100" height="100" fill="green"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/requiredextensions-empty-string.svg b/testing/web-platform/tests/svg/struct/reftests/requiredextensions-empty-string.svg
new file mode 100644
index 0000000000..28f5da4a3e
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/requiredextensions-empty-string.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>requiredExtensions: present but empty attribute evaluates to false</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#RequiredExtensionsAttribute"/>
+ <h:link rel="match" href="../scripted/blank.svg"/>
+ <rect width="100" height="100" fill="red" requiredExtensions=""/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/requiredextensions-xhtml.tentative.svg b/testing/web-platform/tests/svg/struct/reftests/requiredextensions-xhtml.tentative.svg
new file mode 100644
index 0000000000..911f983cab
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/requiredextensions-xhtml.tentative.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>requiredExtensions: support for HTML/XHTML (non-normative)</title>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <switch>
+ <foreignObject width="100" height="100" requiredExtensions="http://www.w3.org/1999/xhtml">
+ <body xmlns="http://www.w3.org/1999/xhtml" style="margin: 0">
+ <div style="width: 100px; height: 100px; background-color: green"></div>
+ </body>
+ </foreignObject>
+ <rect width="100" height="100" fill="red"/>
+ </switch>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg b/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg
new file mode 100644
index 0000000000..6f7fb0f830
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <symbol id="green-square" viewBox="0 0 16 16">
+ <rect width="16" height="16" fill="green"/>
+ </symbol>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg.headers b/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg.headers
new file mode 100644
index 0000000000..3f0c26c8fe
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/support/etag-max-age-zero-icons.svg.headers
@@ -0,0 +1,2 @@
+ETag: icons
+Cache-Control: max-age=0
diff --git a/testing/web-platform/tests/svg/struct/reftests/support/red-rect.svg b/testing/web-platform/tests/svg/struct/reftests/support/red-rect.svg
new file mode 100644
index 0000000000..1ee578ab6a
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/support/red-rect.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="red-rect" width="100" height="100" fill="red"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/support/sprites.svg b/testing/web-platform/tests/svg/struct/reftests/support/sprites.svg
new file mode 100644
index 0000000000..f73b885191
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/support/sprites.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="green-rect" width="100" height="100" fill="green"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-a.svg b/testing/web-platform/tests/svg/struct/reftests/use-a.svg
new file mode 100644
index 0000000000..40d4c83f21
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-a.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>Testing that 'use' can target 'a' elements</title>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <a id="a">
+ <rect width="100" height="100" fill="green"/>
+ </a>
+ </defs>
+ <rect x="10" y="10" width="80" height="80" fill="red"/>
+
+ <use href="#a"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-adopted-with-external-resource.tentative.svg b/testing/web-platform/tests/svg/struct/reftests/use-adopted-with-external-resource.tentative.svg
new file mode 100644
index 0000000000..830d4555e5
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-adopted-with-external-resource.tentative.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>Adopting a &#x3c;use&#x3e; (from an inactive document) requests an external resource</title>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <script type="text/plain" template=""><![CDATA[
+ <svg xmlns="http://www.w3.org/2000/svg">
+ <use href="support/sprites.svg#green-rect"/>
+ </svg>]]>
+ </script>
+ <script>
+ let text = document.querySelector('script[template]').textContent;
+ let doc = new DOMParser().parseFromString(text, 'image/svg+xml');
+ document.documentElement.appendChild(doc.documentElement);
+ </script>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-cross-origin.svg b/testing/web-platform/tests/svg/struct/reftests/use-cross-origin.svg
new file mode 100644
index 0000000000..3de069c8d1
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-cross-origin.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>&#x3c;use&#x3e; with a cross-origin resource</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <rect width="100" height="100" fill="green"/>
+ <script>
+ const svg = document.querySelector('svg');
+ const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
+ use.setAttribute('href', location.href.replace('://', '://www1.') + '/../support/red-rect.svg#red-rect');
+ svg.appendChild(use);
+ </script>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-data-url.tentative.svg b/testing/web-platform/tests/svg/struct/reftests/use-data-url.tentative.svg
new file mode 100644
index 0000000000..04414030a3
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-data-url.tentative.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>&#x3c;use&#x3e; with a data: URL resource</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <rect width="100" height="100" fill="green"/>
+ <use href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IGlkPSJyZWQtcmVjdCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9InJlZCIvPgo8L3N2Zz4=#red-rect"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-external-resource-with-revalidation.tentative.html b/testing/web-platform/tests/svg/struct/reftests/use-external-resource-with-revalidation.tentative.html
new file mode 100644
index 0000000000..d899165fa9
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-external-resource-with-revalidation.tentative.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>Multiple &lt;use> referencing same external resource, with revalidation required</title>
+<link rel="match" href="reference/green-100x100.html">
+<svg>
+ <rect width="100" height="100" fill="red"/>
+</svg>
+<script>
+ let container = document.querySelector('svg');
+ function makeUse(x) {
+ let use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
+ use.setAttribute('href', 'support/etag-max-age-zero-icons.svg#green-square');
+ use.setAttribute('x', x);
+ use.setAttribute('width', 50);
+ use.setAttribute('height', 50);
+ use.setAttribute('transform', 'scale(1, 2)');
+ return use;
+ }
+ function insertFirstUse() {
+ let use = makeUse(0);
+ use.onload = insertSecondUse;
+ container.appendChild(use);
+ }
+ function insertSecondUse() {
+ let use = makeUse(50);
+ use.onload = endTest;
+ container.appendChild(use);
+ document.body.offsetTop;
+ }
+ function endTest() {
+ document.documentElement.classList.remove('reftest-wait');
+ }
+ onload = function() {
+ requestAnimationFrame(insertFirstUse);
+ };
+</script>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-inheritance-001.svg b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-001.svg
new file mode 100644
index 0000000000..5e375b94cd
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-001.svg
@@ -0,0 +1,35 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Use property inheritance in SVG2</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseStyleInheritance"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <h:link rel="author" title="Mike Bremford" href="http://bfo.com"/>
+ </metadata>
+ <style>
+ use rect { stroke: red }
+ .container rect { fill: red; stroke: red }
+ rect { stroke-width: 40px; stroke: green }
+ rect:root { opacity: 0 }
+ </style>
+ <defs>
+ <g class="container">
+ <rect id="r" x="20" y="20" width="60" height="60" style="fill-opacity:1"/>
+ </g>
+ </defs>
+ <g>
+ <use href="#r" xlink:href="#r" style="fill: green; fill-opacity:0"/>
+ </g>
+ <!--
+ This presume the SVG2 use inheritance rules, in SVG1 it will display as red.
+
+ 1. The "rect" cloned by the "use" element is in a shadow DOM, so it DOES NOT
+ inherit the stroke from the "use rect" or ".container rect" style rules.
+ 2. The cloned "rect" DOES get the rules set by the "rect" style rule, as that
+ still matches elements in the shadow DOM.
+ 3. The "rect" DOES inherit "fill: green" from the <use>
+ 4. The "rect"'s own "fill-opacity: 1" overrides the "fill-opacity: 0" inherited
+ from the "use" element.
+ 5. Even though "rect" is considered to have no parent, it is not a root element
+ so does not match the rect:root style rule
+ -->
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-child-of.svg b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-child-of.svg
new file mode 100644
index 0000000000..1c4a395407
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-child-of.svg
@@ -0,0 +1,37 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Use property inheritance with :nth-child(... of &lt;selector list&gt;) in SVG2</title>
+ <metadata>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseStyleInheritance"/>
+ <h:link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1821258"/>
+ <h:link rel="author" title="Zach Hoffman" href="mailto:zach@zrhoffman.net"/>
+ </metadata>
+ <style>
+ :nth-child(n of use rect) { stroke: red }
+ :nth-child(n of .container rect) { fill: red; stroke: red }
+ rect { stroke-width: 40px; stroke: green }
+ rect:root { opacity: 0 }
+ </style>
+ <defs>
+ <g class="container">
+ <rect id="r" x="20" y="20" width="60" height="60" style="fill-opacity:1"/>
+ </g>
+ </defs>
+ <g>
+ <use href="#r" xlink:href="#r" style="fill: green; fill-opacity:0"/>
+ </g>
+ <!--
+ This presumes the SVG2 use inheritance rules, in SVG1 it will display as red.
+
+ 1. The "rect" cloned by the "use" element is in a shadow DOM, so it DOES NOT
+ inherit the stroke from the ":nth-child(n of use rect)" or
+ ":nth-child(n of .container rect)" style rules.
+ 2. The cloned "rect" DOES get the rules set by the "rect" style rule, as that
+ still matches elements in the shadow DOM.
+ 3. The "rect" DOES inherit "fill: green" from the <use>
+ 4. The "rect"'s own "fill-opacity: 1" overrides the "fill-opacity: 0" inherited
+ from the "use" element.
+ 5. Even though "rect" is considered to have no parent, it is not a root element
+ so does not match the rect:root style rule
+ -->
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-last-child-of.svg b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-last-child-of.svg
new file mode 100644
index 0000000000..229be9cbf9
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-inheritance-nth-last-child-of.svg
@@ -0,0 +1,37 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Use property inheritance with :nth-last-child(... of &lt;selector list&gt;) in SVG2</title>
+ <metadata>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseStyleInheritance"/>
+ <h:link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1821258"/>
+ <h:link rel="author" title="Zach Hoffman" href="mailto:zach@zrhoffman.net"/>
+ </metadata>
+ <style>
+ :nth-last-child(n of use rect) { stroke: red }
+ :nth-last-child(n of .container rect) { fill: red; stroke: red }
+ rect { stroke-width: 40px; stroke: green }
+ rect:root { opacity: 0 }
+ </style>
+ <defs>
+ <g class="container">
+ <rect id="r" x="20" y="20" width="60" height="60" style="fill-opacity:1"/>
+ </g>
+ </defs>
+ <g>
+ <use href="#r" xlink:href="#r" style="fill: green; fill-opacity:0"/>
+ </g>
+ <!--
+ This presumes the SVG2 use inheritance rules, in SVG1 it will display as red.
+
+ 1. The "rect" cloned by the "use" element is in a shadow DOM, so it DOES NOT
+ inherit the stroke from the ":nth-last-child(n of use rect)" or
+ ":nth-last-child(n of .container rect)" style rules.
+ 2. The cloned "rect" DOES get the rules set by the "rect" style rule, as that
+ still matches elements in the shadow DOM.
+ 3. The "rect" DOES inherit "fill: green" from the <use>
+ 4. The "rect"'s own "fill-opacity: 1" overrides the "fill-opacity: 0" inherited
+ from the "use" element.
+ 5. Even though "rect" is considered to have no parent, it is not a root element
+ so does not match the rect:root style rule
+ -->
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-no-tspan.svg b/testing/web-platform/tests/svg/struct/reftests/use-no-tspan.svg
new file mode 100644
index 0000000000..5368ca343c
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-no-tspan.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>Testing that 'use' cannot make 'tspan' elements visible</title>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <text><tspan id="t" x="20" y="100" fill="red" font-size="36">Should not see this</tspan></text>
+ </defs>
+ <rect width="100" height="100" fill="green"/>
+
+ <use href="#t"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-same-origin.svg b/testing/web-platform/tests/svg/struct/reftests/use-same-origin.svg
new file mode 100644
index 0000000000..0aa1ec83af
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-same-origin.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>&#x3c;use&#x3e; with a same-origin resource</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <use href="support/sprites.svg#green-rect"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-001.svg b/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-001.svg
new file mode 100644
index 0000000000..c658adce80
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-001.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:h="http://www.w3.org/1999/xhtml" width="800" height="600">
+ <title>'width' and 'height' from &#x3c;use&#x3e; overrides values on referenced &#x3c;svg&#x3e;</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseLayout"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <svg id="s" width="10" height="10">
+ <rect width="100%" height="100%" fill="green"/>
+ </svg>
+ </defs>
+ <rect width="100" height="100" fill="red"/>
+ <svg width="1" height="1" overflow="visible">
+ <use xlink:href="#s" x="90" y="90"/>
+ <use xlink:href="#s" y="90" width="90"/>
+ <use xlink:href="#s" x="90" height="90"/>
+ <use xlink:href="#s" width="90" height="90"/>
+ </svg>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-002.svg b/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-002.svg
new file mode 100644
index 0000000000..6c3f97b8dc
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-svg-dimensions-override-002.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:h="http://www.w3.org/1999/xhtml" width="800" height="600">
+ <title>'width' and 'height' from &#x3c;use&#x3e; overrides values on referenced &#x3c;svg&#x3e;</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseLayout"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <svg id="s">
+ <rect width="100%" height="100%" fill="green"/>
+ </svg>
+ </defs>
+ <rect width="100" height="100" fill="red"/>
+ <svg width="10" height="10" overflow="visible">
+ <use xlink:href="#s" x="90" y="90"/>
+ <use xlink:href="#s" y="90" width="90"/>
+ <use xlink:href="#s" x="90" height="90"/>
+ <use xlink:href="#s" width="90" height="90"/>
+ </svg>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-switch.svg b/testing/web-platform/tests/svg/struct/reftests/use-switch.svg
new file mode 100644
index 0000000000..6c01c30198
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-switch.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>Testing that 'use' can target 'switch' elements</title>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <switch id="s">
+ <rect width="100" height="100" fill="green"/>
+ </switch>
+ </defs>
+ <rect x="10" y="10" width="80" height="80" fill="red"/>
+
+ <use href="#s"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-001.svg b/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-001.svg
new file mode 100644
index 0000000000..1f8f714147
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-001.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:h="http://www.w3.org/1999/xhtml" width="800" height="600">
+ <title>'width' and 'height' from &#x3c;use&#x3e; overrides values on referenced &#x3c;symbol&#x3e;</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseLayout"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <symbol id="s" width="10" height="10">
+ <rect width="100%" height="100%" fill="green"/>
+ </symbol>
+ </defs>
+ <rect width="100" height="100" fill="red"/>
+ <svg width="1" height="1" overflow="visible">
+ <use xlink:href="#s" x="90" y="90"/>
+ <use xlink:href="#s" y="90" width="90"/>
+ <use xlink:href="#s" x="90" height="90"/>
+ <use xlink:href="#s" width="90" height="90"/>
+ </svg>
+</svg>
diff --git a/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-002.svg b/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-002.svg
new file mode 100644
index 0000000000..9c1fd49083
--- /dev/null
+++ b/testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-002.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:h="http://www.w3.org/1999/xhtml" width="800" height="600">
+ <title>'width' and 'height' from &#x3c;use&#x3e; overrides values on referenced &#x3c;symbol&#x3e;</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseLayout"/>
+ <h:link rel="match" href="reference/green-100x100.svg"/>
+ <defs>
+ <symbol id="s">
+ <rect width="100%" height="100%" fill="green"/>
+ </symbol>
+ </defs>
+ <rect width="100" height="100" fill="red"/>
+ <svg width="10" height="10" overflow="visible">
+ <use xlink:href="#s" x="90" y="90"/>
+ <use xlink:href="#s" y="90" width="90"/>
+ <use xlink:href="#s" x="90" height="90"/>
+ <use xlink:href="#s" width="90" height="90"/>
+ </svg>
+</svg>