mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision fd0429f0b45f975b25d85256dac33762134952c5
This commit is contained in:
parent
0ba7da4431
commit
c8202ddbe1
50 changed files with 1210 additions and 191 deletions
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/feature-policy/experimental-features/resources/common.js"></script>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
width: 100%;
|
||||
height: 10000px;
|
||||
}
|
||||
</style>
|
||||
<div class="spacer"></div>
|
||||
<script>
|
||||
let load_timeout = 600; // ms
|
||||
let expected_timeout_msg = false;
|
||||
|
||||
let cross_origin_url =
|
||||
"http://{{hosts[alt][www]}}:{{ports[http][0]}}/" +
|
||||
"feature-policy/experimental-features/resources/lazyload-contents.html";
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
// Verify that when 'loading-frame-default-eager' policy is disabled, the
|
||||
// loading attribute "auto" leads to lazy loading.
|
||||
promise_test(async(t) => {
|
||||
// Add a frame with load="off".
|
||||
let frame_loading_auto = createIframe(document.body, {
|
||||
id: "auto",
|
||||
// Sets the "loading" attribute to "auto".
|
||||
loading: "auto",
|
||||
src: `${cross_origin_url}?id=auto`
|
||||
});
|
||||
// Sanity-check: The frame is not visible.
|
||||
assert_greater_than(
|
||||
frame_loading_auto.getBoundingClientRect().top,
|
||||
window.innerHeight * 2,
|
||||
"Unexpected position for <iframe> with ID 'auto'.");
|
||||
let msg_or_timeout =
|
||||
await waitForMessageOrTimeout(t, "auto", load_timeout);
|
||||
assert_false(msg_or_timeout, "Expected the frame not to load.");
|
||||
}, "When 'loading-frame-default-eager' feature is disabled, a frame with " +
|
||||
"'loading attribute 'auto' will be lazily loaded.");
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Feature-Policy: loading-frame-default-eager 'none'
|
Loading…
Add table
Add a link
Reference in a new issue