Bug 1529046 [wpt PR 15421] - CDC versus Ident Token, a=testonly
authorTab Atkins Jr <jackalmage@gmail.com>
Tue, 05 Mar 2019 12:17:42 +0000
changeset 464237 4fe6634c3cea124be78a269bbf19afc8a804f75e
parent 464236 da708ab85cc67a562f57700543722de285dc8d72
child 464238 97385559862c64231031e1cfde2766f63be10b74
push id35713
push usercbrindusan@mozilla.com
push dateFri, 15 Mar 2019 21:55:43 +0000
treeherdermozilla-central@66b1aba3fb43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1529046, 15421
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529046 [wpt PR 15421] - CDC versus Ident Token, a=testonly 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
testing/web-platform/tests/css/css-syntax/cdc-vs-ident-tokens.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-syntax/cdc-vs-ident-tokens.html
@@ -0,0 +1,28 @@
+<!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>