Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee

This commit is contained in:
WPT Sync Bot 2018-04-23 21:13:37 -04:00
parent c5f7c9ccf3
commit e891345f26
1328 changed files with 36632 additions and 20588 deletions

View file

@ -6,22 +6,31 @@
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
var check = function(element, selectors) {
var check = function(element, selectors, qsRoot) {
for (var i = 0; i < selectors.length; ++i) {
var selector = selectors[i][0];
var expected = selectors[i][1];
test(function() {
assert_equals(expected, element.matches(selector));
if (qsRoot) {
assert_equals(expected, element === qsRoot.querySelector(selector));
var qsa = qsRoot.querySelectorAll(selector);
assert_equals(expected, !!qsa.length && element === qsa[0]);
}
}, "Expected " + element.tagName + " element to " +
(expected ? "match " : "not match ") + selector);
(expected ? "match " : "not match ") + selector + " with matches" +
(qsRoot ? ", querySelector(), and querySelectorAll()" : ""));
}
}
var rootOfSubtreeSelectors = [
[ ":first-child", true ],
[ ":last-child", true ],
[ ":only-child", true ],
[ ":first-of-type", true ],
[ ":last-of-type", true ],
[ ":only-of-type", true ],
[ ":nth-child(1)", true ],
[ ":nth-child(n)", true ],
[ ":nth-last-child(1)", true ],
@ -36,6 +45,11 @@ var rootOfSubtreeSelectors = [
[ ":nth-last-of-type(2)", false],
];
check(document.documentElement, rootOfSubtreeSelectors);
check(document.documentElement, rootOfSubtreeSelectors, document);
check(document.createElement('div'), rootOfSubtreeSelectors);
var fragment = document.createDocumentFragment();
var div = document.createElement('div');
fragment.appendChild(div);
check(div, rootOfSubtreeSelectors, fragment);
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

View file

@ -0,0 +1,7 @@
<!doctype html>
<title>CSS Test Reference</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1449010">
<p>
Some text <img src="resources/blue15x15.png"> some more.
</p>

View file

@ -0,0 +1,15 @@
<!doctype html>
<title>CSS Test Reference</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1449010">
<p>
Some text <img src="resources/blue15x15.png"> some more.
</p>
<script>
onload = () => {
getSelection().removeAllRanges();
let r = document.createRange();
r.selectNode(document.documentElement);
getSelection().addRange(r);
}
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<title>::selection is respected on images</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1449010">
<link rel="mismatch" href="selection-image-001-noref.html">
<style>
img::-moz-selection {
background: green;
}
img::selection {
background: green;
}
</style>
<p>
Some text <img src="resources/blue15x15.png"> some more.
</p>
<script>
onload = () => {
getSelection().removeAllRanges();
let r = document.createRange();
r.selectNode(document.documentElement);
getSelection().addRange(r);
}
</script>

View file

@ -0,0 +1,16 @@
<!doctype html>
<title>CSS Test: Image and text selection is painted.</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1449010">
<link rel="mismatch" href="selection-image-001-no-selection-noref.html">
<p>
Some text <img src="resources/blue15x15.png"> some more.
</p>
<script>
onload = () => {
getSelection().removeAllRanges();
let r = document.createRange();
r.selectNode(document.documentElement);
getSelection().addRange(r);
}
</script>