Skip to content

Commit

Permalink
Add WPT parser tests for :state().
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D193364

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1864298
gecko-commit: 83cdf13e881cda7a9e5f06d00979c72ec9e7c225
gecko-reviewers: emilio
  • Loading branch information
keithamus authored and moz-wptsync-bot committed Nov 13, 2023
1 parent 8bb6ce8 commit 90b3819
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions css/selectors/parsing/parse-state.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8" />
<title>CSS Selectors: custom state pseudo selectors</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/8213" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_valid_selector(":state(--foo)");
test_valid_selector(":state(bar)");
test_valid_selector(":state(--)");
test_valid_selector(":state(--0)");
test_valid_selector(":host(:state(--foo))");
test_valid_selector('my-input[type="foo"]:state(checked)');
test_valid_selector('my-input[type="foo"]:state(--0)::before');
test_invalid_selector(":state");
test_invalid_selector(":state(");
test_invalid_selector(":state()");
test_invalid_selector(":state(0)");
test_invalid_selector(":state(0rem)");
test_invalid_selector(":state(url())");
test_invalid_selector(":state(foo(1))");
test_invalid_selector(":state(:host)");
</script>

0 comments on commit 90b3819

Please sign in to comment.