Bug 1526603 [wpt PR 15234] - Add support for freezing iframes, a=testonly
authorDave Tapuska <dtapuska@chromium.org>
Mon, 18 Feb 2019 19:25:29 +0000
changeset 519183 6bb753349bac88fd89c6fab123686066f7dc12cb
parent 519182 7c76dcfe4b9df67d7458946b31786f8771f70788
child 519184 e8c1d8c4df0b3419410103565387c564c9697e6b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [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>