Update web-platform-tests to revision b'51407aaa3d17aa440f6807caef5e390dc779087a'

This commit is contained in:
WPT Sync Bot 2021-02-25 08:20:53 +00:00
parent 60b642968b
commit 4db11786c5
263 changed files with 6777 additions and 1228 deletions

View file

@ -28,54 +28,51 @@
loading="eager">
<script>
document.getElementById("js_display_none").style = 'display:none;';
</script>
</body>
<script>
const visibility_hidden_element = document.getElementById("visibility_hidden");
const visibility_hidden_element_explicit_eager =
document.getElementById("visibility_hidden_explicit_eager");
const visibility_hidden_element = document.getElementById("visibility_hidden");
const visibility_hidden_element_explicit_eager =
document.getElementById("visibility_hidden_explicit_eager");
const display_none_element = document.getElementById("display_none");
const display_none_element_explicit_eager =
document.getElementById("display_none_explicit_eager");
const display_none_element = document.getElementById("display_none");
const display_none_element_explicit_eager =
document.getElementById("display_none_explicit_eager");
const attribute_hidden_element = document.getElementById("attribute_hidden");
const attribute_hidden_element_explicit_eager =
document.getElementById("attribute_hidden_explicit_eager");
const attribute_hidden_element = document.getElementById("attribute_hidden");
const attribute_hidden_element_explicit_eager =
document.getElementById("attribute_hidden_explicit_eager");
const js_display_none_element = document.getElementById("js_display_none");
const js_display_none_element_explicit_eager =
document.getElementById("js_display_none_explicit_eager");
const js_display_none_element = document.getElementById("js_display_none");
const js_display_none_element_explicit_eager =
document.getElementById("js_display_none_explicit_eager");
let have_images_loaded = false;
let have_images_loaded = false;
async_test(t => {
let image_fully_loaded_promise = (element) => {
return new Promise(resolve => {
element.addEventListener("load", t.step_func(resolve));
});
}
async_test(t => {
let image_fully_loaded_promise = (element) => {
return new Promise(resolve => {
element.addEventListener("load", t.step_func(resolve));
});
}
Promise.all([
image_fully_loaded_promise(visibility_hidden_element),
image_fully_loaded_promise(visibility_hidden_element_explicit_eager),
image_fully_loaded_promise(display_none_element),
image_fully_loaded_promise(display_none_element_explicit_eager),
image_fully_loaded_promise(attribute_hidden_element),
image_fully_loaded_promise(attribute_hidden_element_explicit_eager),
image_fully_loaded_promise(js_display_none_element),
image_fully_loaded_promise(js_display_none_element_explicit_eager)
]).then(t.step_func(() => {
have_images_loaded = true;
})).catch(t.unreached_func("All images should load correctly"));
Promise.all([
image_fully_loaded_promise(visibility_hidden_element),
image_fully_loaded_promise(visibility_hidden_element_explicit_eager),
image_fully_loaded_promise(display_none_element),
image_fully_loaded_promise(display_none_element_explicit_eager),
image_fully_loaded_promise(attribute_hidden_element),
image_fully_loaded_promise(attribute_hidden_element_explicit_eager),
image_fully_loaded_promise(js_display_none_element),
image_fully_loaded_promise(js_display_none_element_explicit_eager)
]).then(t.step_func(() => {
have_images_loaded = true;
})).catch(t.unreached_func("All images should load correctly"));
window.addEventListener("load", t.step_func_done(() => {
assert_true(have_images_loaded,
"The images should block the window load event.");
}));
window.addEventListener("load", t.step_func_done(() => {
assert_true(have_images_loaded,
"The images should block the window load event.");
}));
}, "Test that below-viewport invisible images that are not marked " +
"loading=lazy still load, and block the window load event");
}, "Test that below-viewport invisible images that are not marked " +
"loading=lazy still load, and block the window load event");
</script>