Bug 1514453 [wpt PR 14535] - vertical-scroll: Policy will not affect main document, a=testonly
authorEhsan Karamad <ekaramad@chromium.org>
Thu, 31 Jan 2019 12:12:35 +0000
changeset 457746 3d56dbd3bb6e44afea8a5d2b8bd794edf3412330
parent 457745 c5e6ce7fcfe6364378f0b830b0cfd8ebe39b148b
child 457747 6f5b6857d05659dddc0fa555824569fa4f5f52b5
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1514453, 14535, 611982, 1378684, 617603
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 1514453 [wpt PR 14535] - vertical-scroll: Policy will not affect main document, a=testonly Automatic update from web-platform-tests vertical-scroll: Policy will not affect main document The purpose of 'vertical-scroll' is to block sub-frames from interfering with main-frame's scrolling. To enforce the policy on the main frame is wrong in that it will block all scrolling on the page. This CL will special-case the main frame scenairo and will not enforce the policy. Same-origin subframes are still affected. TBR=iclelland@chromium.org Bug: 611982 Change-Id: I2fbe882cc65af6f7ed542ebc0151df9f281e9ab2 Reviewed-on: https://chromium-review.googlesource.com/c/1378684 Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Ehsan Karamad <ekaramad@chromium.org> Cr-Commit-Position: refs/heads/master@{#617603} -- wpt-commits: 7ed525acfb4133c1177fdb1ff8477e2a6469e6b4 wpt-pr: 14535
testing/web-platform/tests/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html
testing/web-platform/tests/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html.headers
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Ensure 'vertical-scroll' does not affect main frame</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/feature-policy/experimental-features/resources/common.js"></script>
+<script src="/feature-policy/experimental-features/resources/vertical-scroll.js"></script>
+<style>
+html, body {
+  height: 100%;
+  width: 100%;
+}
+.spacer {
+  width: 100%;
+  height: 100%;
+  margin-top: 100%;
+  margin-bottom: 100%;
+}
+</style>
+<p> Making sure there is room for vertical scroll </p>
+<div class="spacer"></div>
+<div class="spacer"></div>
+</p>EOP</p>
+<script>
+  "use strict";
+
+  // Sanity check.
+  test(() => {
+    assert_false(document.policy.allowsFeature("vertical-scroll"),
+                 "Expected 'vertical-scroll' to be disabled.");
+  }, "'vertical-scroll' disabled in main document.");
+
+  // Wait for the helper scripts to load.
+  promise_test(async() => {
+    if (window.input_api_ready)
+      return Promise.resolve();
+    await new Promise( (r) => {
+      window.resolve_on_input_api_ready = r;
+    });
+  }, "Make sure input injection API is ready.");
+
+  promise_test(async() => {
+    window.scrollTo(0, 0);
+    await inject_input("down");
+    assert_greater_than(window.scrollY, 0, "Page must have scrolled down.");
+  }, "Verify that the page scrolls vertically.");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html.headers
@@ -0,0 +1,1 @@
+Feature-Policy: vertical-scroll 'none'