Bug 1273275: scroll to the top of elements before interacting r=ato a=test-only
authorDavid Burns <dburns@mozilla.com>
Tue, 17 May 2016 11:04:30 +0100
changeset 333242 35c64e20fc9a4cb80627abf9ca24dc0fe231273f
parent 333241 fa7b938306444925723b7f53dae21608c3a7ae41
child 333243 d41dfe6fd3350c8a09e4a4bc3fe78d18749035ab
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1273275
milestone48.0a2
Bug 1273275: scroll to the top of elements before interacting r=ato a=test-only This allows us to converge with webdriver project which scrolls to the start of the element instead of the end. MozReview-Commit-ID: ErQ18bTeo5m
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -839,17 +839,17 @@ element.isVisible = function(el, x = und
   }
 
   if (el.tagName.toLowerCase() == "body") {
     return true;
   }
 
   if (!element.inViewport(el, x, y)) {
     if (el.scrollIntoView) {
-      el.scrollIntoView(false);
+      el.scrollIntoView({block: "start", inline: "nearest"});
       if (!element.inViewport(el)) {
         return false;
       }
     } else {
       return false;
     }
   }
   return true;