Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-view-transitions/parsing/pseudo-elements-valid.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>Test pseudo elements parsing of valid selectors</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
const functionPseudoElements = [
"::view-transition-group",
"::view-transition-image-pair",
"::view-transition-old",
"::view-transition-new",
];
function test_valid_selector_combinations(pseudo) {
test_valid_selector(pseudo);
test_valid_selector(`:root${pseudo}`);
test_valid_selector(`.a${pseudo}`);
test_valid_selector(`div ${pseudo}`);
}
test_valid_selector_combinations("::view-transition");
for (const functionName of functionPseudoElements) {
for (const validArgument of ["*", "root", "dashed-ident"]) {
test_valid_selector_combinations(`${functionName}(${validArgument})`);
test_valid_selector_combinations(`${functionName}(${validArgument}):only-child`);
}
}
</script>