Files
tubestation/testing/web-platform/tests/lifecycle/child-display-none.tentative.html
Dave Tapuska 7f7bbba359 Bug 1547562 [wpt PR 16366] - Add feature policies for controlling an iframe lifecycle., a=testonly
Automatic update from web-platform-tests
Add feature policies for controlling an iframe lifecycle.

Two feature policies are added
"allow-execution-while-not-rendered" and
"allow-execution-while-out-of-viewport"

https://github.com/dtapuska/iframe-freeze
https://github.com/WICG/page-lifecycle/pull/32

BUG=907125

Change-Id: I89aeb78ce48b0cacc3c7cc84f4d556a1c431487f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1567893
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654070}

--

wpt-commits: 1a6b90531a6b56aafce0abce2cc28784ec305b58
wpt-pr: 16366
2019-06-05 10:27:36 +01:00

37 lines
881 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Child frame marked as frozen</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
async_test((t) => {
var child = document.createElement('iframe');
var loaded = false;
var frozen = false;
window.addEventListener('message', t.step_func((e) => {
if (e.data == "load") {
loaded = true;
} else if (e.data == "freeze") {
assert_true(loaded);
frozen = true;
child.style = "display: block";
} else if (e.data == "resume") {
assert_true(loaded);
assert_true(frozen);
t.done();
}
}));
child.allow = "execution-while-not-rendered 'none'";
child.src = "resources/subframe.html";
document.body.appendChild(child);
child.style = "display: none";
}, "Child frame frozen");
</script>
</body>