Bug 1273275: scroll to the top of elements before interacting r?ato draft
authorDavid Burns <dburns@mozilla.com>
Tue, 17 May 2016 11:04:30 +0100
changeset 367733 3b6b75eea6625456da14433d96a222eac5de74c8
parent 367571 dd29998a7d44c0caa79881afe494024890b91676
child 521096 a6d6a05d5d35b08774b4f2ac7cebad269477c22a
push id18342
push userdburns@mozilla.com
push dateTue, 17 May 2016 10:05:57 +0000
reviewersato
bugs1273275
milestone49.0a1
Bug 1273275: scroll to the top of elements before interacting r?ato 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;