Bug 1254521 - Add return type docs for element.inViewport; r?automatedtester
MozReview-Commit-ID: Budv7EapTfo
--- 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),