mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 8ae1ddbc812733c3a73b103eafad56fb43a2f4b5
This commit is contained in:
parent
d44e9aced2
commit
0e5e5db397
109 changed files with 2053 additions and 708 deletions
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<title>Unclosed Constructs Are Valid</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<meta name="author" title="Tab Atkins-Bittner">
|
||||
<link rel=help href="https://drafts.csswg.org/css-syntax/#rule-defs">
|
||||
|
||||
<!--
|
||||
Tests that unclosed constructs are valid and match grammars,
|
||||
because grammar-matching only sees the "block",
|
||||
not the opening/closing characters themselves.
|
||||
-->
|
||||
|
||||
<script>
|
||||
|
||||
function validSelector(str) {
|
||||
try {
|
||||
document.querySelector(str);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function shouldBeValid(str) {
|
||||
test(()=>{
|
||||
assert_true(validSelector(str));
|
||||
}, `"${str}" is a valid selector`)
|
||||
}
|
||||
|
||||
shouldBeValid("[foo]");
|
||||
shouldBeValid("[foo");
|
||||
shouldBeValid(":nth-child(1)");
|
||||
shouldBeValid(":nth-child(1");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue