summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-masking/parsing/mask-valid.sub.html
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/css/css-masking/parsing/mask-valid.sub.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.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/css/css-masking/parsing/mask-valid.sub.html')
-rw-r--r--testing/web-platform/tests/css/css-masking/parsing/mask-valid.sub.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-masking/parsing/mask-valid.sub.html b/testing/web-platform/tests/css/css-masking/parsing/mask-valid.sub.html
new file mode 100644
index 0000000000..c6e2c28af5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-masking/parsing/mask-valid.sub.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Masking Module Level 1: parsing mask with valid values</title>
+<link rel="help" href="https://www.w3.org/TR/css-masking-1/#the-mask">
+<meta name="assert" content="mask supports the full '<mask-layer>#' grammar.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+// <mask-layer> = <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> ||
+// <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>
+
+// <mask-reference> = none | <image> | <mask-source>
+test_valid_value('mask', 'none');
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue)');
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) luminance');
+test_valid_value('mask', 'url("https://{{host}}/")');
+
+// <position> [ / <bg-size> ]?
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) 1px 2px');
+test_valid_value('mask', 'url("https://{{host}}/") 1px 2px / contain');
+
+// <repeat-style> = repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
+test_valid_value('mask', 'repeat-y');
+
+// <geometry-box> = <shape-box> | fill-box | stroke-box | view-box
+// <shape-box> = <box> | margin-box
+// <box> = border-box | padding-box | content-box
+test_valid_value('mask', 'border-box', 'none');
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) padding-box');
+test_valid_value('mask', 'content-box');
+test_valid_value('mask', 'margin-box');
+test_valid_value('mask', 'url("https://{{host}}/") fill-box');
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) stroke-box');
+test_valid_value('mask', 'view-box');
+
+// [ <geometry-box> | no-clip ]
+test_valid_value('mask', 'no-clip');
+
+// <compositing-operator> = add | subtract | intersect | exclude
+test_valid_value('mask', 'url("https://{{host}}/") add', 'url("https://{{host}}/")');
+test_valid_value('mask', 'subtract');
+test_valid_value('mask', 'url("https://{{host}}/") intersect');
+test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) exclude');
+
+// <masking-mode> = alpha | luminance | auto
+test_valid_value('mask', 'alpha');
+test_valid_value('mask', 'url("https://{{host}}/") alpha');
+
+// <mask-layer> = <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> ||
+// <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>
+test_valid_value('mask', 'intersect no-clip space round 1px 2px / contain stroke-box linear-gradient(to left bottom, red, blue) luminance', 'linear-gradient(to left bottom, red, blue) luminance 1px 2px / contain space round stroke-box no-clip intersect');
+test_valid_value('mask', 'intersect no-clip space round 1px 2px / contain view-box, stroke-box linear-gradient(to left bottom, red, blue) luminance', '1px 2px / contain space round view-box no-clip intersect, linear-gradient(to left bottom, red, blue) luminance stroke-box');
+
+// Earlier versions of the mask shorthand always required a <mask-reference>.
+// To avoid unnecessarily losing test coverage, keep one of the test cases from back then.
+test_valid_value('mask', 'none alpha', 'alpha');
+
+</script>
+</body>
+</html>