Bug 1546835 - Rename `width` and `height` to `scroller_width` and `scroller_height`. r=jfkthame
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 25 Apr 2019 11:17:51 +0000
changeset 530191 2a5912039aa5694e2a5bc39d47cdddf50f5cc0c9
parent 530190 1f482a604473abe22881a03b0bbbf192ead349b7
child 530192 ad09822ed130815c71376f093e9518400ee1faa2
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1546835
milestone68.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 1546835 - Rename `width` and `height` to `scroller_width` and `scroller_height`. r=jfkthame Differential Revision: https://phabricator.services.mozilla.com/D28754
testing/web-platform/tests/css/css-scroll-snap/snap-inline-block.html
--- a/testing/web-platform/tests/css/css-scroll-snap/snap-inline-block.html
+++ b/testing/web-platform/tests/css/css-scroll-snap/snap-inline-block.html
@@ -27,27 +27,27 @@ div {
 </style>
 
 <div id="scroller">
   <div id="space"></div>
   <div id="target"></div>
 </div>
 
 <script>
-var scroller = document.getElementById("scroller");
-var width = scroller.clientWidth;
-var height = scroller.clientHeight;
+const scroller_width = scroller.clientWidth;
+const scroller_height = scroller.clientHeight;
 [
-  ["horizontal-tb", 300, 500 - height],
-  ["vertical-lr", 500 - width, 300],
-  ["vertical-rl", width - 700, 300]
+  ["horizontal-tb", 300,                  500 - scroller_height],
+  ["vertical-lr",   500 - scroller_width, 300],
+  ["vertical-rl",   scroller_width - 700, 300]
 ].forEach(([writing_mode, left, top]) => {
   test(() => {
     scroller.style.writingMode = writing_mode;
-    if (writing_mode == "vertical-rl")
-      document.getElementById("target").style.left = (width - 700) + "px";
+    if (writing_mode == "vertical-rl") {
+      target.style.left = (scroller_width - 700) + "px";
+    }
     scroller.scrollTo(0, 0);
     assert_equals(scroller.scrollLeft, left, "aligns correctly on x");
     assert_equals(scroller.scrollTop, top, "aligns correctly on y");
   }, "Snaps correctly for " + writing_mode +
      " writing mode with 'inline' and 'block' alignments");
 })
 </script>