mirror of
https://github.com/servo/servo.git
synced 2025-09-07 13:38:20 +01:00
Update web-platform-tests to revision 4052654d786236b493d2df3cb80b9d3d1d0a8354
This commit is contained in:
parent
eab848df3e
commit
3b6ddd885a
116 changed files with 4255 additions and 821 deletions
|
@ -24,6 +24,9 @@ var tests = [
|
|||
['[foo="bar" i]', '[foo="bar" i]'],
|
||||
['[foo="bar" /**/ i]', '[foo="bar" i]'],
|
||||
['[foo="bar"/**/i]', '[foo="bar" i]'],
|
||||
['[foo="bar" s]', '[foo="bar" s]'],
|
||||
['[foo="bar" /**/ s]', '[foo="bar" s]'],
|
||||
['[foo="bar"/**/s]', '[foo="bar" s]'],
|
||||
]
|
||||
|
||||
tests.forEach(function(arr) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<style></style>
|
||||
<div id=test foo="BAR"></div>
|
||||
<div id=test foo="BAR" baz="quux"></div>
|
||||
<script>
|
||||
var mode = "quirks mode";
|
||||
</script>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<style></style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="test" foo="BAR"/>
|
||||
<div id="test" foo="BAR" baz="quux"/>
|
||||
<script>
|
||||
var mode = "XML";
|
||||
</script>
|
||||
|
|
|
@ -12,6 +12,17 @@ setup({explicit_done:true});
|
|||
var match = [
|
||||
// [selector, attrs...] (each attr is [ns, name, value])
|
||||
["[foo='BAR'] /* sanity check (match) */", ["", "foo", "BAR"]],
|
||||
["[foo='bar'] /* sanity check (match) */", ["", "foo", "bar"]],
|
||||
["[align='left'] /* sanity check (match) */", ["", "align", "left"]],
|
||||
["[class~='a'] /* sanity check (match) */", ["", "class", "X a b"]],
|
||||
["[class~='A'] /* sanity check (match) */", ["", "class", "x A B"]],
|
||||
["[id^='a'] /* sanity check (match) */", ["", "id", "ab"]],
|
||||
["[id$='A'] /* sanity check (match) */", ["", "id", "XA"]],
|
||||
["[lang|='a'] /* sanity check (match) */", ["", "lang", "a-b"]],
|
||||
["[lang*='A'] /* sanity check (match) */", ["", "lang", "XAB"]],
|
||||
["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (match) */",
|
||||
["http://www.w3.org/XML/1998/namespace", "lang", "A"]],
|
||||
// Case-insensitive matching.
|
||||
["[foo='bar' i]", ["", "foo", "BAR"]],
|
||||
["[foo='' i]", ["", "foo", ""]],
|
||||
["[foo='a\u0308' i] /* COMBINING in both */", ["", "foo", "A\u0308"]],
|
||||
|
@ -32,9 +43,47 @@ var match = [
|
|||
["[foo='bar' i][foo='bar' i]", ["", "foo", "BAR"]],
|
||||
["[foo='BAR'][foo='bar' i]", ["", "foo", "BAR"]],
|
||||
["[foo='bar' i][foo='BAR']", ["", "foo", "BAR"]],
|
||||
// Case-sensitive matching.
|
||||
["[foo='bar' s]", ["", "foo", "bar"]],
|
||||
["[foo='' s]", ["", "foo", ""]],
|
||||
["[foo='a\u0308' s] /* COMBINING in both */", ["", "foo", "a\u0308"]],
|
||||
["[*|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "x"], ["b", "foo", "bar"], ["c", "foo", "x"]],
|
||||
["[*|foo='bar' s]", ["", "foo", "bar"], ["a", "foo", "x"], ["b", "foo", "x"], ["c", "foo", "x"]],
|
||||
["[align='left' s]", ["", "align", "left"]],
|
||||
["[align='LEFT' s]", ["", "align", "LEFT"]],
|
||||
["[class~='a' s]", ["", "class", "x a b"]],
|
||||
["[class~='A' s]", ["", "class", "X A B"]],
|
||||
["[id^='a' s]", ["", "id", "ab"]],
|
||||
["[id$='A' s]", ["", "id", "XA"]],
|
||||
["[lang|='a' s]", ["", "lang", "a-b"]],
|
||||
["[lang*='A' s]", ["", "lang", "XAB"]],
|
||||
["[*|lang='a' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]],
|
||||
["[*|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]],
|
||||
["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]],
|
||||
["[foo='BAR' s][foo='BAR' s]", ["", "foo", "BAR"]],
|
||||
];
|
||||
|
||||
var matchHTMLOnly = [
|
||||
["[align='left'] /* sanity check (match HTML) */", ["", "align", "LEFT"]],
|
||||
["[align='LEFT'] /* sanity check (match HTML) */", ["", "align", "left"]],
|
||||
["[lang|='a'] /* sanity check (match HTML) */", ["", "lang", "A-B"]],
|
||||
["[lang*='A'] /* sanity check (match HTML) */", ["", "lang", "xab"]],
|
||||
];
|
||||
|
||||
var nomatch = [
|
||||
["[missingattr] /* sanity check (no match) */", ["", "foo", "BAR"]],
|
||||
["[foo='bar'] /* sanity check (no match) */", ["", "foo", "BAR"]],
|
||||
["[class~='a'] /* sanity check (no match) */", ["", "class", "X A B"]],
|
||||
["[class~='A'] /* sanity check (no match) */", ["", "class", "x a b"]],
|
||||
["[id^='a'] /* sanity check (no match) */", ["", "id", "AB"]],
|
||||
["[id$='A']", ["", "id", "xa"]],
|
||||
["[*|lang='a'] /* sanity check (no match) */",
|
||||
["http://www.w3.org/XML/1998/namespace", "lang", "A"]],
|
||||
["[*|lang='A'] /* sanity check (no match) */",
|
||||
["http://www.w3.org/XML/1998/namespace", "lang", "a"]],
|
||||
["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (no match) */",
|
||||
["http://www.w3.org/XML/1998/namespace", "lang", "a"]],
|
||||
// Case-insensitive matching.
|
||||
["[foo='' i]", ["", "foo", "BAR"]],
|
||||
["[foo='\u0000' i] /* \\0 in selector */", ["", "foo", ""]],
|
||||
["[foo='' i] /* \\0 in attribute */", ["", "foo", "\u0000"]],
|
||||
|
@ -73,6 +122,66 @@ var nomatch = [
|
|||
["@namespace x 'A'; [x|foo='' i]", ["a", "foo", ""]],
|
||||
["[foo='bar' i][foo='bar']", ["", "foo", "BAR"]],
|
||||
["[foo='bar' i]", ["", "baz", "BAR"]],
|
||||
// Case-sensitive matching
|
||||
["[foo='' s]", ["", "foo", "BAR"]],
|
||||
["[foo='\u0000' s] /* \\0 in selector */", ["", "foo", ""]],
|
||||
["[foo='' s] /* \\0 in attribute */", ["", "foo", "\u0000"]],
|
||||
["[foo='\u00E4' s]", ["", "foo", "\u00C4"]],
|
||||
["[foo='\u00C4' s]", ["", "foo", "\u00E4"]],
|
||||
["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00C4"]],
|
||||
["[foo~='a\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00E4"]],
|
||||
["[foo^='A\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00C4"]],
|
||||
["[foo$='A\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00E4"]],
|
||||
["[foo*='\u00E4' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]],
|
||||
["[foo|='\u00E4' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]],
|
||||
["[foo='\u00C4' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]],
|
||||
["[foo='\u00C4' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]],
|
||||
["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "a"]],
|
||||
["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "A"]],
|
||||
["[foo='A\u0308' s] /* COMBINING in selector */", ["", "foo", "a"]],
|
||||
["[foo='A\u0308' s] /* COMBINING in selector */", ["", "foo", "A"]],
|
||||
["[foo='a' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]],
|
||||
["[foo='A' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]],
|
||||
["[foo='a' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]],
|
||||
["[foo='A' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]],
|
||||
["[foo='i' s]", ["", "foo", "\u0130"]],
|
||||
["[foo='i' s]", ["", "foo", "\u0131"]],
|
||||
["[foo='I' s]", ["", "foo", "\u0130"]],
|
||||
["[foo='I' s]", ["", "foo", "\u0131"]],
|
||||
["[foo='\u0130' s]", ["", "foo", "i"]],
|
||||
["[foo='\u0131' s]", ["", "foo", "i"]],
|
||||
["[foo='\u0130' s]", ["", "foo", "I"]],
|
||||
["[foo='\u0131' s]", ["", "foo", "I"]],
|
||||
["[foo='bar' s]", ["", "foo", "x"], ["a", "foo", "BAR"]],
|
||||
["[|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "BAR"]],
|
||||
["[foo='bar' s]", ["", "FOO", "bar"]],
|
||||
["[foo='\t' s] /* tab in selector */", ["", "foo", " "]],
|
||||
["[foo=' ' s] /* tab in attribute */", ["", "foo", "\t"]],
|
||||
["@namespace x 'a'; [x|foo='' s]", ["A", "foo", ""]],
|
||||
["@namespace x 'A'; [x|foo='' s]", ["a", "foo", ""]],
|
||||
["[foo='bar' s][foo='bar']", ["", "foo", "BAR"]],
|
||||
["[foo='bar' s]", ["", "baz", "BAR"]],
|
||||
["[foo='bar' s]", ["", "foo", "BAR"]],
|
||||
["[foo='a\u0308' s] /* COMBINING in both */", ["", "foo", "A\u0308"]],
|
||||
["[foo='A\u0308' s] /* COMBINING in both */", ["", "foo", "a\u0308"]],
|
||||
["[*|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "x"], ["b", "foo", "BAR"], ["c", "foo", "x"]],
|
||||
["[*|foo='bar' s]", ["", "foo", "BAR"], ["a", "foo", "x"], ["b", "foo", "x"], ["c", "foo", "x"]],
|
||||
["[align='left' s]", ["", "align", "LEFT"]],
|
||||
["[align='LEFT' s]", ["", "align", "left"]],
|
||||
["[class~='a' s]", ["", "class", "X A B"]],
|
||||
["[class~='A' s]", ["", "class", "x a b"]],
|
||||
["[id^='a' s]", ["", "id", "AB"]],
|
||||
["[id$='A' s]", ["", "id", "xa"]],
|
||||
["[lang|='a' s]", ["", "lang", "A-B"]],
|
||||
["[lang*='A' s]", ["", "lang", "xab"]],
|
||||
["[*|lang='a' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]],
|
||||
["[*|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]],
|
||||
["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]],
|
||||
["[foo='bar' s][foo='bar' s]", ["", "foo", "BAR"]],
|
||||
["[foo='BAR' s][foo='bar']", ["", "foo", "BAR"]],
|
||||
["[foo='bar'][foo='BAR' s]", ["", "foo", "BAR"]],
|
||||
["[foo='BAR'][foo='bar' s]", ["", "foo", "BAR"]],
|
||||
["[foo='bar' s][foo='BAR']", ["", "foo", "bar"]],
|
||||
];
|
||||
var mode = "standards mode";
|
||||
function format_attrs(attrs) {
|
||||
|
@ -107,7 +216,11 @@ onload = function() {
|
|||
elm.setAttributeNS(attr[0], attr[1], attr[2]);
|
||||
});
|
||||
}
|
||||
match.forEach(function(arr) {
|
||||
var localMatch = match.slice();
|
||||
if (global != xml) {
|
||||
localMatch.push(...matchHTMLOnly);
|
||||
}
|
||||
localMatch.forEach(function(arr) {
|
||||
var s = arr[0];
|
||||
var attrs = arr.slice(1);
|
||||
var ns_decl = s.substr(0, "@namespace".length) == "@namespace";
|
||||
|
|
|
@ -5,13 +5,15 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style></style>
|
||||
<div id=log></div>
|
||||
<div id=test foo="BAR"></div>
|
||||
<div id=test foo="BAR" baz="quux"></div>
|
||||
<iframe id="quirks" src="resources/syntax-quirks.html"></iframe>
|
||||
<iframe id="xml" src="resources/syntax-xml.xhtml"></iframe>
|
||||
<script>
|
||||
setup({explicit_done:true});
|
||||
var valid = [
|
||||
"[foo='BAR'] /* sanity check (valid) */",
|
||||
"[baz='quux'] /* sanity check (valid) */",
|
||||
// Case-insensitive selectors.
|
||||
"[foo='bar' i]",
|
||||
"[foo='bar' I]",
|
||||
"[foo=bar i]",
|
||||
|
@ -28,6 +30,7 @@ var valid = [
|
|||
"[foo='bar'\ri\r] /* \\r */",
|
||||
"[foo='bar' \\i]",
|
||||
"[foo='bar' \\69]",
|
||||
"[foo='bar' \\49]",
|
||||
"[foo~='bar' i]",
|
||||
"[foo^='bar' i]",
|
||||
"[foo$='bar' i]",
|
||||
|
@ -35,6 +38,31 @@ var valid = [
|
|||
"[foo|='bar' i]",
|
||||
"[|foo='bar' i]",
|
||||
"[*|foo='bar' i]",
|
||||
// Case-sensitive selectors.
|
||||
"[baz='quux' s]",
|
||||
"[baz='quux' S]",
|
||||
"[baz=quux s]",
|
||||
'[baz="quux" s]',
|
||||
"[baz='quux's]",
|
||||
"[baz='quux's ]",
|
||||
"[baz='quux' s ]",
|
||||
"[baz='quux' /**/ s]",
|
||||
"[baz='quux' s /**/ ]",
|
||||
"[baz='quux'/**/s/**/]",
|
||||
"[baz=quux/**/s]",
|
||||
"[baz='quux'\ts\t] /* \\t */",
|
||||
"[baz='quux'\ns\n] /* \\n */",
|
||||
"[baz='quux'\rs\r] /* \\r */",
|
||||
"[baz='quux' \\s]",
|
||||
"[baz='quux' \\73]",
|
||||
"[baz='quux' \\53]",
|
||||
"[baz~='quux' s]",
|
||||
"[baz^='quux' s]",
|
||||
"[baz$='quux' s]",
|
||||
"[baz*='quux' s]",
|
||||
"[baz|='quux' s]",
|
||||
"[|baz='quux' s]",
|
||||
"[*|baz='quux' s]",
|
||||
];
|
||||
var invalid = [
|
||||
"[foo[ /* sanity check (invalid) */",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue