summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/path/distance
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/path/distance
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/path/distance')
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-positive-percentage.svg36
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-positive-ref.svg32
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-positive.svg38
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage-ref.svg30
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage.svg36
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-zero-ref.svg26
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathLength-zero.svg39
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-circle-mutating.svg16
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-path-mutating.svg15
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-path-negative.svg7
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-path-zero.svg7
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-path.svg8
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-rect-mutating.svg17
-rw-r--r--testing/web-platform/tests/svg/path/distance/pathlength-rect.svg7
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-path-mutating-ref.svg5
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-path-negative-ref.svg5
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-path-ref.svg5
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-path-zero-ref.svg4
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-mutating-ref.svg3
-rw-r--r--testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-ref.svg5
20 files changed, 341 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-positive-percentage.svg b/testing/web-platform/tests/svg/path/distance/pathLength-positive-percentage.svg
new file mode 100644
index 0000000000..d8e28b0889
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-positive-percentage.svg
@@ -0,0 +1,36 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200"
+ font-family="sans-serif" font-size="28">
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="pathLength-positive-ref.svg"/>
+ <h:meta name="assert" content="pathLength scales distance along the path"/>
+ </metadata>
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none" d="M 50 50 h 200" pathLength="2"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="0%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="50%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="-50%">The quick brown fox</textPath>
+ </text>
+ </g>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-positive-ref.svg b/testing/web-platform/tests/svg/path/distance/pathLength-positive-ref.svg
new file mode 100644
index 0000000000..9a9a1a8d47
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-positive-ref.svg
@@ -0,0 +1,32 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200">
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none"
+ d="M 50 50 h 200"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="0%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="50%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="-50%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+</svg>
+
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-positive.svg b/testing/web-platform/tests/svg/path/distance/pathLength-positive.svg
new file mode 100644
index 0000000000..798b7ff3b8
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-positive.svg
@@ -0,0 +1,38 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200">
+
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="pathLength-positive-ref.svg"/>
+ <h:meta name="assert" content="pathLength scales distance along the path"/>
+ </metadata>
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none" d="M 50 50 h 200" pathLength="2"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="0">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="1">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="-1">The quick brown fox</textPath>
+ </text>
+ </g>
+
+</svg>
+
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage-ref.svg b/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage-ref.svg
new file mode 100644
index 0000000000..dca91c1b5f
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage-ref.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200"
+ font-family="sans-serif" font-size="28">
+ <defs>
+ <path id="track" stroke="lightblue" fill="none" d="M 50 50 h 200"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track">The quick brown fox</textPath>
+ </text>
+ </g>
+</svg>
+
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage.svg b/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage.svg
new file mode 100644
index 0000000000..24213e443d
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-zero-percentage.svg
@@ -0,0 +1,36 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200"
+ font-family="sans-serif" font-size="28">
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="pathLength-zero-percentage-ref.svg"/>
+ <h:meta name="assert" content="A value of zero is valid and must be treated as a scaling factor of infinity."/>
+ </metadata>
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none" d="M 50 50 h 200" pathLength="0"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="0%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="50%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text>
+ <textPath xlink:href="#track" startOffset="-50%">The quick brown fox</textPath>
+ </text>
+ </g>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-zero-ref.svg b/testing/web-platform/tests/svg/path/distance/pathLength-zero-ref.svg
new file mode 100644
index 0000000000..d5556add66
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-zero-ref.svg
@@ -0,0 +1,26 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200">
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none"
+ d="M 50 50 h 200"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="0%">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ </g>
+
+</svg>
+
diff --git a/testing/web-platform/tests/svg/path/distance/pathLength-zero.svg b/testing/web-platform/tests/svg/path/distance/pathLength-zero.svg
new file mode 100644
index 0000000000..4ae0b836f7
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathLength-zero.svg
@@ -0,0 +1,39 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="300" height="200" viewBox="0 0 300 200">
+
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="pathLength-zero-ref.svg"/>
+ <h:meta name="assert" content="A value of zero is valid and must be treated as a scaling factor of infinity."/>
+ </metadata>
+
+ <defs>
+ <path id="track" stroke="lightblue" fill="none"
+ d="M 50 50 h 200" pathLength="0"/>
+ </defs>
+
+ <g>
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="0">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,50)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="1">The quick brown fox</textPath>
+ </text>
+ </g>
+
+ <g transform="translate(0,100)">
+ <use xlink:href="#track"/>
+ <text font-family="sans-serif" font-size="28">
+ <textPath xlink:href="#track" startOffset="-1">The quick brown fox</textPath>
+ </text>
+ </g>
+
+</svg>
+
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-circle-mutating.svg b/testing/web-platform/tests/svg/path/distance/pathlength-circle-mutating.svg
new file mode 100644
index 0000000000..a033962e6a
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-circle-mutating.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" class="reftest-wait"
+ width="100" height="100">
+ <title>Mutating the 'pathLength' attribute ('circle' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="../../linking/reftests/reference/green-100x100.svg"/>
+ <circle cx="100" cy="50" r="100" fill="red" pathLength="6400"
+ stroke="green" stroke-width="200" stroke-dasharray="200"/>
+ <script>
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ document.querySelector('circle').setAttribute('pathLength', 200);
+ document.documentElement.classList.toggle("reftest-wait");
+ });
+ });
+ </script>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-path-mutating.svg b/testing/web-platform/tests/svg/path/distance/pathlength-path-mutating.svg
new file mode 100644
index 0000000000..b3f71653f4
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-path-mutating.svg
@@ -0,0 +1,15 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" class="reftest-wait">
+ <title>Mutating the 'pathLength' attribute ('path' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-path-mutating-ref.svg"/>
+ <path pathLength="800" d="M100,100h100v100h-100z" fill="none"
+ stroke="blue" stroke-width="20" stroke-dasharray="25"/>
+ <script>
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ document.querySelector('path').setAttribute('pathLength', 200);
+ document.documentElement.classList.toggle("reftest-wait");
+ });
+ });
+ </script>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-path-negative.svg b/testing/web-platform/tests/svg/path/distance/pathlength-path-negative.svg
new file mode 100644
index 0000000000..ce782dbef7
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-path-negative.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>The 'pathLength' attribute set to a negative value ('path' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-path-negative-ref.svg"/>
+ <path d="M10,10L110,10L110,110L10,110Z" pathLength="-4" stroke-dashoffset="1" stroke-dasharray="1 1"
+ fill="none" stroke="black" stroke-width="10"></path>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-path-zero.svg b/testing/web-platform/tests/svg/path/distance/pathlength-path-zero.svg
new file mode 100644
index 0000000000..f5c4168cd5
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-path-zero.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>The 'pathLength' attribute set to zero ('path' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-path-zero-ref.svg"/>
+ <path d="M10,10L110,10L110,110L10,110Z" pathLength="0" stroke-dashoffset="1" stroke-dasharray="1 1"
+ fill="none" stroke="black" stroke-width="10"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-path.svg b/testing/web-platform/tests/svg/path/distance/pathlength-path.svg
new file mode 100644
index 0000000000..79402505ca
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-path.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>The 'pathLength' attribute ('path' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-path-ref.svg"/>
+ <path d="M10,10L110,10L110,110L10,110Z" pathLength="4"
+ stroke-dashoffset="1" stroke-dasharray="1 1"
+ fill="none" stroke="black" stroke-width="10"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-rect-mutating.svg b/testing/web-platform/tests/svg/path/distance/pathlength-rect-mutating.svg
new file mode 100644
index 0000000000..2dcbe44079
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-rect-mutating.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" class="reftest-wait"
+ width="100" height="100">
+ <title>Mutating the 'pathLength' attribute ('rect' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-rect-mutating-ref.svg"/>
+ <rect y="50" width="200" height="100" fill="red"
+ stroke="green" stroke-width="100" stroke-dasharray="100"
+ pathLength="4800"/>
+ <script>
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ document.querySelector('rect').setAttribute('pathLength', 600);
+ document.documentElement.classList.toggle("reftest-wait");
+ });
+ });
+ </script>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/pathlength-rect.svg b/testing/web-platform/tests/svg/path/distance/pathlength-rect.svg
new file mode 100644
index 0000000000..106fed5f2e
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/pathlength-rect.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>The 'pathLength' attribute ('rect' element)</title>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute"/>
+ <h:link rel="match" href="reference/pathlength-rect-ref.svg"/>
+ <rect width="50" height="50" pathLength="4" fill="blue"
+ stroke-dashoffset="1" stroke-dasharray="1 1" stroke="black" stroke-width="10"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-mutating-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-mutating-ref.svg
new file mode 100644
index 0000000000..fe45125f6b
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-mutating-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>Mutating the 'pathLength' attribute ('path' element; reference)</title>
+ <path d="M100,100h100v100h-100z" fill="none" stroke="blue"
+ stroke-width="20" stroke-dasharray="50"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-negative-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-negative-ref.svg
new file mode 100644
index 0000000000..c4dfb1b2b5
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-negative-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>The 'pathLength' attribute set to a negative value ('path' element; reference)</title>
+ <path d="M10,10L110,10L110,110L10,110Z" stroke-dashoffset="1" stroke-dasharray="1 1"
+ fill="none" stroke="black" stroke-width="10"></path>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-ref.svg
new file mode 100644
index 0000000000..79aca87204
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>The 'pathLength' attribute ('path' element; reference)</title>
+ <path d="M10,10L110,10L110,110L10,110Z" stroke-dashoffset="100" stroke-dasharray="100 100"
+ fill="none" stroke="black" stroke-width="10"></path>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-zero-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-zero-ref.svg
new file mode 100644
index 0000000000..232bf66cbc
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-path-zero-ref.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>The 'pathLength' attribute set to zero ('path' element; reference)</title>
+ <path d="M10,10L110,10L110,110L10,110Z" fill="none" stroke="black" stroke-width="10"/>
+</svg>
diff --git a/testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-mutating-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-mutating-ref.svg
new file mode 100644
index 0000000000..120941444a
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-mutating-ref.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/path/distance/reference/pathlength-rect-ref.svg b/testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-ref.svg
new file mode 100644
index 0000000000..232178d732
--- /dev/null
+++ b/testing/web-platform/tests/svg/path/distance/reference/pathlength-rect-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>The 'pathLength' attribute ('rect' element; reference)</title>
+ <rect width="50" height="50" fill="blue"
+ stroke-dashoffset="50" stroke-dasharray="50 50" stroke="black" stroke-width="10"/>
+</svg>