Bug 1254521 - Add return type docs for element.inViewport; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 08 Mar 2016 13:53:00 +0000
changeset 338108 b064cc04ce1277f053e22bb00e0c32293fe56cb6
parent 338107 dadb4135791341f044a3cf2b97fff5291d40d374
child 515724 0b87c12aad2e405337b007297975ade263d5c6e9
push id12428
push userbmo:ato@mozilla.com
push dateTue, 08 Mar 2016 14:00:49 +0000
reviewersautomatedtester
bugs1254521
milestone48.0a1
Bug 1254521 - Add return type docs for element.inViewport; r?automatedtester MozReview-Commit-ID: Budv7EapTfo
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -770,24 +770,27 @@ element.coordinates = function(node, x =
     x: box.left + x,
     y: box.top + y,
   };
 };
 
 /**
  * This function returns true if the node is in the viewport.
  *
- * @param {Element} element
+ * @param {Element} el
  *     Target element.
  * @param {number=} x
  *     Horizontal offset relative to target.  Defaults to the centre of
  *     the target's bounding box.
  * @param {number=} y
  *     Vertical offset relative to target.  Defaults to the centre of
  *     the target's bounding box.
+ *
+ * @return {boolean}
+ *     True if if |el| is in viewport, false otherwise.
  */
 element.inViewport = function(el, x = undefined, y = undefined) {
   let win = el.ownerDocument.defaultView;
   let c = element.coordinates(el, x, y);
   let vp = {
     top: win.pageYOffset,
     left: win.pageXOffset,
     bottom: (win.pageYOffset + win.innerHeight),