Skip to content

Commit 27125ea

Browse files
Use viewport units to make room to scroll on any size of browser window.
The android device screen size we use on our CI is 1080x1920 [1], thus a 1000x1000 element doesn't make room to scroll. This patch basically replaces `height: 1000px` with `height: 200vh` and replaces `width: 1000px` with `width: 200vw`. But there are two exceptions, after-transition-reload.html and manual-scroll-reload.html. In the two tests there's an element named "#buffer" which is used to calculate expected scroll positions, so if it were replaced by viewport units value, the expected scroll positions will end up being calculated based on viewport units which depends on the browser window size, it would be unfortunate. That's said, in these tests there's another large element so that it ensures the document is scrollable. [1] https://searchfox.org/firefox-main/rev/10bd7783b8730460c539eb8a0ce0a116af701ad2/python/mozboot/mozboot/android-avds/android34-x86_64.json#12 Differential Revision: https://phabricator.services.mozilla.com/D265053 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1988930 gecko-commit: 82d8a76cd9628c45cf6f68f42341510ade2ae87e gecko-reviewers: farre
1 parent 8bbc331 commit 27125ea

23 files changed

+25
-25
lines changed

navigation-api/scroll-behavior/after-transition-basic.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-change-history-scroll-restoration-during-promise.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-explicit-scroll.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div id="main" style="height: 1000px; width: 1000px;"></div>
6+
<div id="main" style="height: 200vh; width: 200vw;"></div>
77
<script>
88
promise_test(async t => {
99
// Wait for after the load event so that the navigation doesn't get converted

navigation-api/scroll-behavior/after-transition-push.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-reject.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-reload.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div id="buffer" style="height: 1000px; width: 1000px;"></div>
6+
<div id="buffer" style="height: 1000px; width: 200vw;"></div>
77
<div id="frag"></div>
8-
<div style="height: 1000px; width: 1000px;"></div>
8+
<div style="height: 200vh; width: 200vw;"></div>
99
<script>
1010
promise_test(async t => {
1111
// Wait for after the load event so that the navigation doesn't get converted

navigation-api/scroll-behavior/after-transition-replace.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-timing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

navigation-api/scroll-behavior/after-transition-with-history-scroll-restoration-manual.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
6-
<div style="height: 1000px; width: 1000px;"></div>
6+
<div style="height: 200vh; width: 200vw;"></div>
77
<div id="frag"></div>
88
<script>
99
promise_test(async t => {

0 commit comments

Comments
 (0)