parse-part.html (2020B)
1 <!doctype html> 2 <meta charset="utf-8" /> 3 <title>CSS Selectors: part pseudo selectors</title> 4 <link rel="help" href="https://drafts.csswg.org/css-shadow-parts/#part" /> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/css/support/parsing-testcommon.js"></script> 8 <script> 9 test_valid_selector("::part(--foo)"); 10 test_valid_selector("::part(bar)"); 11 test_valid_selector("::part(--)"); 12 test_valid_selector("::part(--0)"); 13 test_valid_selector("::part(foo bar)"); 14 test_valid_selector("::part(-foo bar)"); 15 test_valid_selector("::part(foo):focus"); 16 test_valid_selector("::part(foo):hover"); 17 test_valid_selector("::part(foo):focus-within"); 18 test_valid_selector("::part(foo)::before"); 19 test_valid_selector("::part(foo)::after"); 20 test_valid_selector("::part(foo)::placeholder"); 21 test_valid_selector("::part(foo)::first-line"); 22 test_valid_selector("::part(foo)::first-letter"); 23 test_valid_selector("::part(foo)::file-selector-button"); 24 test_valid_selector("::part(foo):is(:focus)"); 25 test_valid_selector(":lang(en)::part(foo)"); 26 test_valid_selector(":dir(ltr)::part(foo)"); 27 test_valid_selector("::part(foo):lang(en)"); 28 test_valid_selector("::part(foo):dir(ltr)"); 29 test_valid_selector("::part(foo):disabled"); 30 test_valid_selector("::part(foo):checked"); 31 test_invalid_selector(":part()"); 32 test_invalid_selector(":part(0)"); 33 test_invalid_selector(":part('foo')"); 34 test_invalid_selector(":part([foo])"); 35 test_invalid_selector('::part(foo) + ::part(bar)'); 36 // Note: the serialization behavior of the following is as resolved in 37 // https://github.com/w3c/csswg-drafts/issues/8356 but it has not yet been 38 // specified. 39 test_valid_forgiving_selector("::part(foo):is(ul)"); 40 test_valid_forgiving_selector("::part(foo):is(nav ul)"); 41 test_valid_forgiving_selector("::part(foo):where(ul)"); 42 test_valid_forgiving_selector("::part(foo):where(nav ul)"); 43 test_invalid_selector("::part(foo):has(li)"); 44 </script>