slotted-parsing.html (2258B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Scoping: ::slotted pseudo parsing</title> 4 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/css/support/parsing-testcommon.js"></script> 9 <style id="styleElm"> 10 </style> 11 <script> 12 test_invalid_selector("::slotted"); 13 test_invalid_selector("::slotted()"); 14 test_invalid_selector("::slotted(*).class"); 15 test_invalid_selector("::slotted(*)#id {}"); 16 test_invalid_selector("::slotted(*)[attr]"); 17 test_invalid_selector("::slotted(*):host"); 18 test_invalid_selector("::slotted(*):host(div)"); 19 test_invalid_selector("::slotted(*):has(span)"); 20 test_invalid_selector("::slotted(*):hover"); 21 test_invalid_selector("::slotted(*):read-only"); 22 test_invalid_selector("::slotted(*)::slotted(*)"); 23 test_invalid_selector("::slotted(*)::before::slotted(*)"); 24 test_invalid_selector("::slotted(*) span"); 25 26 test_valid_selector("::slotted(*)"); 27 test_valid_selector("::slotted(div)"); 28 test_valid_selector("::slotted([attr]:hover)"); 29 test_valid_selector("::slotted(:not(.a))"); 30 31 test_valid_forgiving_selector("::slotted(*):is()"); 32 test_valid_forgiving_selector("::slotted(*):is(:hover)"); 33 test_valid_forgiving_selector("::slotted(*):is(#id)"); 34 35 test_valid_forgiving_selector("::slotted(*):where()"); 36 test_valid_forgiving_selector("::slotted(*):where(:hover)"); 37 test_valid_forgiving_selector("::slotted(*):where(#id)"); 38 test_valid_forgiving_selector("::slotted(*):where(::before)"); 39 40 // Allow tree-abiding pseudo elements after ::slotted 41 test_valid_selector("::slotted(*)::before"); 42 test_valid_selector("::slotted(*)::after"); 43 test_valid_selector("::slotted(*)::details-content"); 44 test_valid_selector("::slotted(*)::file-selector-button"); 45 test_valid_selector("::slotted(*)::placeholder"); 46 test_valid_selector("::slotted(*)::marker"); 47 48 // Other pseudo elements not valid after ::slotted 49 test_invalid_selector("::slotted(*)::first-line"); 50 test_invalid_selector("::slotted(*)::first-letter"); 51 test_invalid_selector("::slotted(*)::selection"); 52 </script>