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 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/svg/struct/reftests
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
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/sprites.svg3
-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-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-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-symbol-dimensions-override-001.svg18
-rw-r--r--testing/web-platform/tests/svg/struct/reftests/use-symbol-dimensions-override-002.svg18
17 files changed, 230 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/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-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-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-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-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>