mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Automatic update from web-platform-tests CDC versus Ident Token Tests <https://github.com/w3c/csswg-drafts/issues/3623>. If the CDC-vs-ident check is performed in the wrong order, you will attempt to parse the CDC as an ident instead, emitting a `--` ident token, and then a `>` delim token. Thus, if this test is parsed incorrectly, it'll instead think the selector is `-- > --foo`, a valid selector with two tagname selectors separated by a child combinator. -- lint: remove trailing whitespace -- Merge pull request #15421 from web-platform-tests/tabatkins-patch-2 CDC versus Ident Token -- wpt-commits: c79dbe6d777590620087aadbceb07668d3f2fd89, bf1be2ec37487a34adb4ac2ca75b7a061d27b8fe, 542f927a85e239ae514db33e73d4421f86b267ae wpt-pr: 15421
28 lines
662 B
HTML
28 lines
662 B
HTML
<!doctype html>
|
|
<title>CDC versus Ident Token</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<style>
|
|
|
|
-->
|
|
|
|
--foo { color: blue; }
|
|
|
|
</style>
|
|
|
|
<meta name=author content="Tab Atkins-Bittner">
|
|
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-token">
|
|
|
|
<!--
|
|
The ordering of the checks in the HYPHEN-MINUS step is important;
|
|
if you get it wrong, ident-token can swallow cdc-token.
|
|
-->
|
|
|
|
<script>
|
|
|
|
test(()=>{
|
|
const rule = document.styleSheets[0].cssRules[0];
|
|
assert_equals(rule.selectorText, "--foo");
|
|
}, "CDC-token is properly emitted, and not parsed as an ident.");
|
|
|
|
</script>
|