Bug 1526603 [wpt PR 15234] - Add support for freezing iframes, a=testonly
☠☠ backed out by 749b314d6c28 ☠ ☠
authorDave Tapuska <dtapuska@chromium.org>
Mon, 18 Feb 2019 19:25:29 +0000
changeset 460277 ce9b01ac64aa12735261776e68f4873e5d883a36
parent 460276 d51d6ded843f88b74d03c54711a41fad6135a223
child 460278 be67fead7966e109802bb563b1a001c8b5a81efa
push id112074
push userwptsync@mozilla.com
push dateThu, 21 Feb 2019 19:59:15 +0000
treeherdermozilla-inbound@a15983fcecca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526603, 15234, 907125, 1450406, 629822
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526603 [wpt PR 15234] - Add support for freezing iframes, a=testonly Automatic update from web-platform-tests Add support for freezing iframes Frames that aren't loading are not visible in the viewport will be frozen if --enable-features=FreezeFrames is provided. This will eventually be converted to testing feature policies for frames. BUG=907125 Change-Id: Ib0badb3f92df4ce4921dd4a4cb29c45749f64f47 Reviewed-on: https://chromium-review.googlesource.com/c/1450406 Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Alexander Timin <altimin@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#629822} -- wpt-commits: d31a2f38a2c7159a88ca190cde7826b91299c64f wpt-pr: 15234
testing/web-platform/tests/lifecycle/child-display-none.tentative.html
testing/web-platform/tests/lifecycle/resources/subframe.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/lifecycle/child-display-none.tentative.html
@@ -0,0 +1,35 @@
+<!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.src = "resources/subframe.html";
+  document.body.appendChild(child);
+  child.style = "display: none";
+}, "Child frame frozen");
+
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/lifecycle/resources/subframe.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script>
+window.addEventListener('load', () => {
+  window.parent.postMessage('load');
+});
+
+document.addEventListener('freeze', () => {
+  window.parent.postMessage('freeze');
+});
+
+document.addEventListener('resume', () => {
+  window.parent.postMessage('resume');
+});
+
+</script>