diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/svg/painting/scripted | |
parent | Initial commit. (diff) | |
download | firefox-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/painting/scripted')
-rw-r--r-- | testing/web-platform/tests/svg/painting/scripted/paint-order-computed-value-01.svg | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/painting/scripted/paint-order-computed-value-01.svg b/testing/web-platform/tests/svg/painting/scripted/paint-order-computed-value-01.svg new file mode 100644 index 0000000000..7ea669f150 --- /dev/null +++ b/testing/web-platform/tests/svg/painting/scripted/paint-order-computed-value-01.svg @@ -0,0 +1,62 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>'paint-order' computed style serialization</title> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <text id="text" x="100" y="100"/> + <script><![CDATA[ + 'use strict'; + + function make_tests(check, type) { + let tests = [ + // Single keyword + ["normal", "normal"], + ["fill", "fill"], + ["stroke", "stroke"], + ["markers", "markers"], + // Two keywords + ["fill stroke", "fill"], + ["fill markers", "fill markers"], + ["stroke fill", "stroke"], + ["stroke markers", "stroke markers"], + ["markers fill", "markers"], + ["markers stroke", "markers stroke"], + // Three keywords + ["fill stroke markers", "fill"], + ["fill markers stroke", "fill markers"], + ["stroke fill markers", "stroke"], + ["stroke markers fill", "stroke markers"], + ["markers fill stroke", "markers"], + ["markers stroke fill", "markers stroke"], + // Invalid + ["foo", "normal"], + ["fill foo", "normal"], + ["stroke foo", "normal"], + ["markers foo", "normal"], + ["normal foo", "normal"], + ["fill markers stroke foo", "normal"], + ]; + for (let [value, expected] of tests) { + test(() => { + check(value, expected); + }, `${document.title}, "${value}" => "${expected}" (${type})`); + } + } + + const text = document.getElementById("text"); + + make_tests((value, expected) => { + text.setAttribute("style", "paint-order: " + value); + let actual = getComputedStyle(text).paintOrder; + text.removeAttribute("style"); + assert_equals(actual, expected, value); + }, "property"); + + make_tests((value, expected) => { + text.setAttribute("paint-order", value); + let actual = getComputedStyle(text).paintOrder; + text.removeAttribute("paint-order"); + assert_equals(actual, expected, value); + }, "presentation attribute"); + ]]> + </script> +</svg> |