Bug 1546835 - Restore the target left property when the test finishes. r=jfkthame
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 25 Apr 2019 11:21:07 +0000
changeset 530192 ad09822ed130815c71376f093e9518400ee1faa2
parent 530191 2a5912039aa5694e2a5bc39d47cdddf50f5cc0c9
child 530193 96fc6f317e8430b1666f8bf89846fc2676b9da24
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 - Restore the target left property when the test finishes. r=jfkthame Othewise subsequent test cases would be affected by the change for 'vertical-rl'. Depends on D28754 Differential Revision: https://phabricator.services.mozilla.com/D28755
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
@@ -35,19 +35,21 @@ div {
 const scroller_width = scroller.clientWidth;
 const scroller_height = scroller.clientHeight;
 [
   ["horizontal-tb", 300,                  500 - scroller_height],
   ["vertical-lr",   500 - scroller_width, 300],
   ["vertical-rl",   scroller_width - 700, 300]
 ].forEach(([writing_mode, left, top]) => {
   test(() => {
+    const target_left = getComputedStyle(target).left;
     scroller.style.writingMode = writing_mode;
     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");
+    target.style.left = target_left;
   }, "Snaps correctly for " + writing_mode +
      " writing mode with 'inline' and 'block' alignments");
 })
 </script>