Bug 1740376 [wpt PR 31570] - [css-conditional] Split CSS.supports() test by spec level., a=testonly

Automatic update from web-platform-tests
[css-conditional] Split CSS.supports() test by spec level.

--

wpt-commits: f60db899302b235660f458972d9ef7f6f7063f7c
wpt-pr: 31570
This commit is contained in:
fantasai 2021-11-13 10:07:06 +00:00 committed by moz-wptsync-bot
parent 66ccb7f8f4
commit 77299f01a9
2 changed files with 33 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS.supports</title>
<link rel="help" href="https://drafts.csswg.org/css-conditional/#dom-css-supports">
<title>CSS.supports() Level 3</title>
<link rel="help" href="https://www.w3.org/TR/css-conditional-3/#the-css-namespace">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
@ -40,28 +40,4 @@
test(function() {
assert_equals(CSS.supports("--foo", "blah"), true);
}, "two argument form succeeds for custom property");
test(function() {
assert_equals(CSS.supports("selector(div)"), true);
}, "selector() function accepts a selector");
test(function() {
assert_equals(CSS.supports("selector(div, div)"), false);
}, "selector() function doesn't accept a selector list");
test(function() {
assert_equals(CSS.supports("selector(::-webkit-unknown-pseudo-element)"), false);
}, "selector() function rejects unknown webkit pseudo-elements.");
test(function() {
assert_equals(CSS.supports("selector(::before)"), true);
}, "selector() function accepts known pseudo-elements");
test(function() {
assert_equals(CSS.supports("selector(div + .c)"), true);
}, "selector() with simple combinators");
test(function() {
assert_equals(CSS.supports("selector(div | .c)"), false);
}, "selector() with unknown combinators");
</script>

View File

@ -0,0 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS.supports() Level 4</title>
<link rel="help" href="https://www.w3.org/TR/css-conditional-4/#the-css-namespace">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_equals(CSS.supports("selector(div)"), true);
}, "selector() function accepts a selector");
test(function() {
assert_equals(CSS.supports("selector(div, div)"), false);
}, "selector() function doesn't accept a selector list");
test(function() {
assert_equals(CSS.supports("selector(::-webkit-unknown-pseudo-element)"), false);
}, "selector() function rejects unknown webkit pseudo-elements.");
test(function() {
assert_equals(CSS.supports("selector(::before)"), true);
}, "selector() function accepts known pseudo-elements");
test(function() {
assert_equals(CSS.supports("selector(div + .c)"), true);
}, "selector() with simple combinators");
test(function() {
assert_equals(CSS.supports("selector(div | .c)"), false);
}, "selector() with unknown combinators");
</script>