Update web-platform-tests to revision 7ed322c3132993bcb5734702b40621448670fc76

This commit is contained in:
WPT Sync Bot 2019-12-24 08:23:56 +00:00
parent 10fa5fa68a
commit 110ca49f65
52 changed files with 1682 additions and 485 deletions

View file

@ -0,0 +1,40 @@
<!DOCTYPE html>
<head>
<title>Images with loading='lazy' load being moved to another document
and then scrolled to</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
</head>
<!--
Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
-->
<body>
<div id="tall_div" style="height:1000vh"></div>
<div id="below_viewport_div"></div>
<img id="below_viewport" src='resources/image.png?below_viewport' loading="lazy">
<script>
const tall_div = document.getElementById("tall_div");
const below_viewport_element = document.getElementById("below_viewport");
const below_viewport_div = document.getElementById("below_viewport_div");
async_test(function(t) {
below_viewport_element.onload =
t.unreached_func("The below viewport image should not load");
t.step_timeout(t.step_func_done(), 1000);
const iframe = document.createElement('iframe');
iframe.setAttribute("style", "display:none");
iframe.srcdoc = "<body></body>";
iframe.onload = () => {
const adopted_img = iframe.contentDocument.adoptNode(below_viewport_element);
iframe.contentDocument.body.appendChild(adopted_img);
below_viewport_div.scrollIntoView();
};
document.body.insertBefore(iframe, tall_div);
}, "Test that <img> below viewport is not loaded when moved to another " +
"document and then scrolled to");
</script>
</body>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<head>
<title>Images with loading='lazy' load being removed and then scrolled to</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
</head>
<!--
Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
-->
<body>
<img id="in_viewport" src='resources/image.png?in_viewport&pipe=trickle(d1)'>
<div style="height:1000vh"></div>
<div id="below_viewport_div"></div>
<img id="below_viewport" src='resources/image.png?below_viewport' loading="lazy">
<script>
const in_viewport_element = document.getElementById("in_viewport");
const below_viewport_element = document.getElementById("below_viewport");
const below_viewport_div = document.getElementById("below_viewport_div");
async_test(t => {
below_viewport_element.onload = t.unreached_func("Removed loading=lazy image " +
"should not load when its old position is scrolled to.");
below_viewport_element.remove();
in_viewport_element.onload = () => {
below_viewport_div.scrollIntoView();
t.step_timeout(t.step_func_done(), 2000);
};
}, "Test that <img> below viewport is not loaded when removed from the " +
"document and then scrolled to");
</script>
</body>