summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-shadow-parts/serialization.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-shadow-parts/serialization.html')
-rw-r--r--testing/web-platform/tests/css/css-shadow-parts/serialization.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-shadow-parts/serialization.html b/testing/web-platform/tests/css/css-shadow-parts/serialization.html
new file mode 100644
index 0000000000..50ad3df53a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-shadow-parts/serialization.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS Shadow Parts - Serialization</title>
+ <link href="https://drafts.csswg.org/css-shadow-parts/" rel="help">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <style id="styleElement">
+ ::part(\(foo) {}
+ ::part( bar\ ) {}
+ ::part( -foo bar ) {}
+ </style>
+ <script>
+ "use strict";
+ const rules = styleElement.sheet.cssRules;
+ test(function() {
+ assert_equals(rules[0].selectorText, "::part(\\(foo)");
+ }, "Escape start parenthesis in ::part name.");
+ test(function() {
+ assert_equals(rules[1].selectorText, "::part(bar\\ )");
+ }, "Escape start space in ::part name.");
+ test(function() {
+ assert_equals(rules[2].selectorText, "::part(-foo bar)");
+ }, "Collapse spaces in ::part names list.");
+ </script>
+ </body>
+</html>