Auto merge of #25303 - servo-wpt-sync:wpt_update_16-12-2019, r=servo-wpt-sync

Sync WPT with upstream (16-12-2019)

Automated downstream sync of changes from upstream as of 16-12-2019.
[no-wpt-sync]
r? @servo-wpt-sync
This commit is contained in:
bors-servo 2019-12-17 04:52:30 -05:00 committed by GitHub
commit 4458bc762c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 215 additions and 57 deletions

View file

@ -277968,6 +277968,9 @@
"lint.whitelist": [
[]
],
"loading/lazyload/META.yml": [
[]
],
"loading/lazyload/common.js": [
[]
],
@ -373157,6 +373160,18 @@
{}
]
],
"loading/lazyload/original-base-url-applied-2-tentative.html": [
[
"loading/lazyload/original-base-url-applied-2-tentative.html",
{}
]
],
"loading/lazyload/original-base-url-applied-iframe-tentative.html": [
[
"loading/lazyload/original-base-url-applied-iframe-tentative.html",
{}
]
],
"loading/lazyload/original-base-url-applied-tentative.html": [
[
"loading/lazyload/original-base-url-applied-tentative.html",
@ -668530,12 +668545,16 @@
"d06f4c59bca28d01632cf693062a7d30ecbd5cc8",
"support"
],
"loading/lazyload/META.yml": [
"cf46037be689ed345755b4c14fc76ae0a9951e8e",
"support"
],
"loading/lazyload/common.js": [
"06f18b3e0498549df1811c6a8008857e65b4117c",
"support"
],
"loading/lazyload/disconnected-image-loading-lazy.tentative.html": [
"c3b72b26239ea18c0575b65d0d6aa3aaef08792d",
"fe6d79fe2a558bae6740932e24ff31c30425225c",
"testharness"
],
"loading/lazyload/iframe-loading-eager.tentative.html": [
@ -668563,7 +668582,15 @@
"testharness"
],
"loading/lazyload/invisible-lazy-image.tentative.html": [
"805d614e401670a5d73199a6771a028a7e41d7d6",
"94f0dbfd6da8178119f51e3be29f77869e46da22",
"testharness"
],
"loading/lazyload/original-base-url-applied-2-tentative.html": [
"debfbadb2b04fc462f8cee0cd1579bf7a8096157",
"testharness"
],
"loading/lazyload/original-base-url-applied-iframe-tentative.html": [
"0734b335781629c4084d6e9646a61d9b80017169",
"testharness"
],
"loading/lazyload/original-base-url-applied-tentative.html": [

View file

@ -309,9 +309,24 @@
[<iframe>: separate response Content-Type: */* text/html]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain]
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL

View file

@ -14,6 +14,3 @@
[Content-Type-Options%3A%20nosniff]
expected: FAIL
[X-Content-Type-Options%3A%20%40%23%24%23%25%25%26%5E%26%5E*()()11!%2Cnosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_5.html]
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,8 +1,4 @@
[skip-document-with-fragment.html]
expected: TIMEOUT
[Autofocus elements in iframed documents with URL fragments should be skipped.]
expected: FAIL
[Autofocus elements in top-level browsing context's documents with URI fragments should be skipped.]
expected: TIMEOUT

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_nonescaping-3.html]
type: testharness
expected: CRASH
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL
expected: NOTRUN

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[crossorigin-sandwich-TAO.sub.html]
expected: ERROR
[There should be one entry.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
spec: https://github.com/whatwg/html/pull/3752
suggested_reviewers:
- domfarolino
- rwlbuis

View file

@ -3,28 +3,30 @@
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
async_test(function(t) {
async_test(t => {
x = new Image();
x.loading = "auto";
x.src = "resources/image.png?auto";
x.onload = e => {
t.step(function() {
t.step_func_done();
});
};
t.step_timeout(function() { t.done(); }, 2000);
x.onload = t.step_func_done();
t.step_timeout(t.unreached_func("Disconnected loading=auto image loads " +
"successfully, and doesn't timeout"), 2000);
}, "loading=auto for disconnected image");
async_test(function(t) {
async_test(t => {
x = new Image();
x.loading = "eager";
x.src = "resources/image.png?eager";
x.onload = t.step_func_done();
t.step_timeout(t.unreached_func("Disconnected loading=eager image loads " +
"successfully, and doesn't timeout"), 2000);
}, "loading=eager for disconnected image");
async_test(t => {
x = new Image();
x.loading = "lazy";
x.src = "resources/image.png?lazy";
x.onload = e => {
t.step(function() {
t.unreached_func("Disconnected image with loading=lazy should be loaded lazily.");
});
};
t.step_timeout(function() { t.done(); }, 2000);
x.onload = t.unreached_func("Disconnected loading=lazy image loads lazily.");
t.step_timeout(t.step_func_done(), 2000);
}, "loading=lazy for disconnected image");
</script>
</body>

View file

@ -8,16 +8,19 @@
</head>
<body>
<img id="expected" src='resources/image.png?1'>
<!-- These two images should load, the latter not blocking the window load event -->
<img id="expected" src='resources/image.png?expected&pipe=trickle(d1)'>
<img id="visibility_hidden" style="visibility:hidden;"
src='resources/image.png?2&pipe=trickle(d1)' loading='lazy'
src='resources/image.png?visibility_hidden&pipe=trickle(d2)' loading='lazy'
onload="visibility_hidden_img.resolve();" onerror="visibility_hidden_img.reject();">
<img id="display_none" style="display:none;" src='resources/image.png?3&pipe=trickle(d1)'
<!-- These images should not load at all -->
<img id="display_none" style="display:none;" src='resources/image.png?display_none'
loading='lazy'
onload="display_none_img.resolve();" onerror="display_none_img.reject();">
<img id="attribute_hidden" hidden src='resources/image.png?4&pipe=trickle(d1)' loading='lazy'
<img id="attribute_hidden" hidden src='resources/image.png?attribute_hidden' loading='lazy'
onload="attribute_hidden_img.resolve();" onerror="attribute_hidden_img.reject();">
<img id="js_display_none" src='resources/image.png?5&pipe=trickle(d1)' loading='lazy'
<img id="js_display_none" src='resources/image.png?js_display_none' loading='lazy'
onload="js_display_none_img.resolve();" onerror="js_display_none_img.reject();">
<script>
document.getElementById("js_display_none").style = 'display:none;';
@ -37,31 +40,39 @@ Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
let has_window_loaded = false;
async_test(function(t) {
window.addEventListener("load", t.step_func(function() {
async_test(t => {
window.addEventListener("load", t.step_func(() => {
has_window_loaded = true;
}));
display_none_img.promise.then(
t.unreached_func("The lazy image with display:none should not load since it is hidden.")
).catch(t.unreached_func("The error event should not fire for lazy images with display none."));
const unreached_not_rendered_img_func =
t.unreached_func("The not-rendered in-viewport loading=lazy images " +
"should not have attempted to load.");
attribute_hidden_img.promise.then(
t.unreached_func("The lazy image with attribute hidden should not load since it is hidden.")
).catch(t.unreached_func("The error event should not fire for lazy image with attribute hidden."));
display_none_img.promise
.then(unreached_not_rendered_img_func)
.catch(unreached_not_rendered_img_func);
js_display_none_img.promise.then(
t.unreached_func("The lazy image with display:none set by JS should not load since it is hidden.")
).catch(t.unreached_func("The error event should not fire for lazy image with display none set by JS."));
attribute_hidden_img.promise
.then(unreached_not_rendered_img_func)
.catch(unreached_not_rendered_img_func);
js_display_none_img.promise
.then(unreached_not_rendered_img_func)
.catch(unreached_not_rendered_img_func);
visibility_hidden_img.promise.then(
t.step_func(function() {
assert_true(is_image_fully_loaded(visibility_hidden_img.element(),
expected));
assert_true(has_window_loaded);
t.step_timeout(function() { t.done(); }, 2000);
t.step_func_done(() => {
assert_true(is_image_fully_loaded(visibility_hidden_img.element(), expected),
"The loading=lazy visibility:hidden image is equivalent " +
"to the expected image.");
assert_true(has_window_loaded,
"The loading=lazy visibility:hidden image does not block " +
"the window load event, and finishes loading after the " +
"window load event fires.");
})
).catch(t.unreached_func("The error event should not fire for lazy image with visibility hidden."));
).catch(t.unreached_func("The loading=lazy visibility:hidden image " +
"should load successfully."));
}, "Test behavior of in viewport invisible lazy images");
</script>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<head>
<title>Deferred images with loading='lazy' use the original
base URL specified at the parse time</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
<base href='/loading/lazyload/resources/'>
</head>
<!--
Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
-->
<script>
const below_viewport_img_promise = new ElementLoadPromise("below_viewport_img");
let has_window_loaded = false;
async_test(function(t) {
// Change the base URL and scroll down to load the deferred elements.
window.addEventListener("load", t.step_func(function() {
const base = document.getElementsByTagName('base')[0];
base.href = '/invalid-url-where-no-subresources-exist/';
has_window_loaded = true;
below_viewport_img_promise.element().scrollIntoView();
}));
below_viewport_img_promise.promise.then(
t.step_func_done(function() {
assert_true(has_window_loaded,
"Below-viewport loading=lazy images do not block the " +
"window load event");
assert_true(below_viewport_img_promise.element().complete,
"The loading=lazy image should be considered complete " +
"upon load.");
assert_greater_than(below_viewport_img_promise.element().naturalWidth,
0,
"The loading=lazy should have non-zero width " +
"upon loading");
})
).catch(t.unreached_func("The image request should not load relative to " +
"the current (incorrect) base URL."));
}, "Deferred images with loading='lazy' use the original base URL " +
"specified at the parse time");
</script>
<body>
<div style="height:1000vh"></div>
<img id="below_viewport_img" src="image.png" loading="lazy"
onload="below_viewport_img_promise.resolve();"
onerror="below_viewport_img_promise.reject();">
</body>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<head>
<title>Deferred iframes with loading='lazy' use the original
base URL specified at the parse time</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
<base href='/loading/lazyload/resources/'>
</head>
<!--
Marked as tentative until Marked as tentative until the HTML Standard
specifies this.
-->
<script>
const below_viewport_iframe_promise = new ElementLoadPromise("below_viewport_iframe");
let has_window_loaded = false;
async_test(function(t) {
// Change the base URL and scroll down to load the deferred elements.
window.addEventListener("load", t.step_func(function() {
const base = document.getElementsByTagName('base')[0];
base.href = '/invalid-url-where-no-subresources-exist/';
has_window_loaded = true;
below_viewport_iframe_promise.element().scrollIntoView();
}));
below_viewport_iframe_promise.promise.then(
t.step_func_done(function() {
assert_true(has_window_loaded,
"Below-viewport loading=lazy iframes do not block the " +
"window load event");
assert_true(below_viewport_iframe_promise.element().contentDocument.body.
innerHTML.includes("<p>Subframe</p>"),
"The loading=lazy iframe's content is accessible upon loading");
})
).catch(t.unreached_func("The iframe request should not load relative to " +
"the current (incorrect) base URL."));
}, "Deferred iframes with loading='lazy' use the original base URL " +
"specified at the parse time");
</script>
<body>
<div style="height:1000vh"></div>
<iframe id="below_viewport_iframe" src="subframe.html" loading="lazy"
width="200px" height="100px" onload="below_viewport_iframe_promise.resolve();"
onerror="below_viewport_iframe_promise.reject();">
</iframe>
</body>