summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/pservers/parsing
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/pservers/parsing
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/pservers/parsing')
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg27
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg24
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg24
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg24
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg20
-rw-r--r--testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg24
6 files changed, 143 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg
new file mode 100644
index 0000000000..b05a69f10b
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>SVG Paint Servers: getComputedStyle().stopColor</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/>
+ <h:link rel="help" href="https://drafts.csswg.org/css-color/#resolve-color-values"/>
+ <h:link rel="help" href="https://drafts.csswg.org/cssom/#serializing-css-values"/>
+ </metadata>
+ <g id="target" style="color: blue"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/computed-testcommon.js"/>
+ <script><![CDATA[
+
+test_computed_value("stop-color", "currentcolor", "rgb(0, 0, 255)");
+test_computed_value("stop-color", "white", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "transparent", "rgba(0, 0, 0, 0)");
+test_computed_value("stop-color", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "#ffffff", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "rgba(255, 255, 255, 1.0)", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "rgba(255, 255, 255, 0.4)");
+test_computed_value("stop-color", "hsl(0deg, 100%, 100%)", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "hsla(0deg, 100%, 100%, 1.0)", "rgb(255, 255, 255)");
+test_computed_value("stop-color", "hsla(0deg, 100%, 100%, 0.4)", "rgba(255, 255, 255, 0.4)");
+
+ ]]></script>
+</svg>
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg
new file mode 100644
index 0000000000..4eee544486
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg
@@ -0,0 +1,24 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>SVG Paint Servers: parsing stop-color with invalid values</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/>
+ </metadata>
+ <g id="target" style="color: blue"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/parsing-testcommon.js"/>
+ <script><![CDATA[
+
+test_invalid_value("stop-color", "auto");
+test_invalid_value("stop-color", "123");
+test_invalid_value("stop-color", "#12");
+test_invalid_value("stop-color", "#123456789");
+test_invalid_value("stop-color", "rgb");
+test_invalid_value("stop-color", "rgb(1)");
+test_invalid_value("stop-color", "rgb(1,2,3,4,5)");
+test_invalid_value("stop-color", "hsla(1,2,3,4,5)");
+test_invalid_value("stop-color", "rgb(10%, 20, 30%)");
+test_invalid_value("stop-color", "rgba(-2, 300, 400%, -0.5)");
+
+ ]]></script>
+</svg>
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg
new file mode 100644
index 0000000000..80d6c23b83
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg
@@ -0,0 +1,24 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
+ <title>SVG Paint Servers: parsing stop-color with valid values</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/>
+ </metadata>
+ <g id="target" style="color: blue"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/parsing-testcommon.js"/>
+ <script><![CDATA[
+
+test_valid_value("stop-color", "currentcolor");
+test_valid_value("stop-color", "white");
+test_valid_value("stop-color", "transparent");
+test_valid_value("stop-color", "rgb(255, 255, 255)");
+test_valid_value("stop-color", "#ffffff", "rgb(255, 255, 255)");
+test_valid_value("stop-color", "rgba(255, 255, 255, 1.0)", "rgb(255, 255, 255)");
+test_valid_value("stop-color", "rgba(255, 255, 255, 0.4)");
+test_valid_value("stop-color", "hsl(0deg, 100%, 100%)", "rgb(255, 255, 255)");
+test_valid_value("stop-color", "hsla(0deg, 100%, 100%, 1.0)", "rgb(255, 255, 255)");
+test_valid_value("stop-color", "hsla(0deg, 100%, 100%, 0.4)", "rgba(255, 255, 255, 0.4)");
+
+ ]]></script>
+</svg>
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg
new file mode 100644
index 0000000000..1ad1e98c5a
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ width="800px" height="800px">
+ <title>SVG Paint Servers: getComputedStyle().stopOpacity</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/>
+ <h:meta name="assert" content="stop-opacity computed value is clamped to the range [0,1]."/>
+ </metadata>
+ <g id="target"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/computed-testcommon.js"/>
+ <script><![CDATA[
+
+test_computed_value("stop-opacity", "-1", "0");
+test_computed_value("stop-opacity", "0.5");
+test_computed_value("stop-opacity", "3", "1");
+test_computed_value("stop-opacity", "-100%", "0");
+test_computed_value("stop-opacity", "50%", "0.5");
+test_computed_value("stop-opacity", "300%", "1");
+
+ ]]></script>
+</svg>
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg
new file mode 100644
index 0000000000..eae9343d14
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ width="800px" height="800px">
+ <title>SVG Paint Servers: parsing stop-opacity with invalid values</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/>
+ <h:meta name="assert" content="stop-opacity supports only the grammar 'alpha-value'."/>
+ </metadata>
+ <g id="target"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/parsing-testcommon.js"/>
+ <script><![CDATA[
+
+test_invalid_value("stop-opacity", "1.");
+test_invalid_value("stop-opacity", "2 3");
+
+ ]]></script>
+</svg>
diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg
new file mode 100644
index 0000000000..28b60038a4
--- /dev/null
+++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ width="800px" height="800px">
+ <title>SVG Paint Servers: parsing stop-opacity with valid values</title>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/>
+ <h:meta name="assert" content="stop-opacity supports the full grammar 'alpha-value'."/>
+ </metadata>
+ <g id="target"></g>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <h:script src="/css/support/parsing-testcommon.js"/>
+ <script><![CDATA[
+
+test_valid_value("stop-opacity", "-1");
+test_valid_value("stop-opacity", "0.5");
+test_valid_value("stop-opacity", "3");
+test_valid_value("stop-opacity", "-100%", "-1");
+test_valid_value("stop-opacity", "50%", "0.5");
+test_valid_value("stop-opacity", "300%", "3");
+
+ ]]></script>
+</svg>