Skip to content
Permalink
Browse files

Update web-platform-tests to revision 47ce6ccdc49acfae697f1e04f90ce76…

…78c78e2db
  • Loading branch information
servo-wpt-sync committed Dec 16, 2019
1 parent b7aaff4 commit bbb2e6233120118b28461eda0aa6ae4709db035b
"lint.whitelist": [
[]
],
"loading/lazyload/META.yml": [
[]
],
"loading/lazyload/common.js": [
[]
],
{}
]
],
"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",
"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": [
"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": [
@@ -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

@@ -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

This file was deleted.

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

@@ -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
@@ -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

This file was deleted.

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

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

@@ -0,0 +1,4 @@
spec: https://github.com/whatwg/html/pull/3752
suggested_reviewers:
- domfarolino
- rwlbuis
@@ -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>
@@ -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 @@

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.");

display_none_img.promise
.then(unreached_not_rendered_img_func)
.catch(unreached_not_rendered_img_func);

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."));
attribute_hidden_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."));
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>

@@ -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>
@@ -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>

0 comments on commit bbb2e62

Please sign in to comment.
You can’t perform that action at this time.