Bug 1410652 - Fix various API documentation in element module. r=whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 24 Oct 2017 17:38:55 +0100
changeset 689634 5fccbd53ab96849df2aece2679db2df84aced804
parent 689633 fbd1dbc73ad4ebfb3b06196eed2d17ea0c4b00f4
child 689635 6475a04bb7709072849547ffc27bd604ec678b07
push id87065
push userbmo:ato@sny.no
push dateTue, 31 Oct 2017 20:11:32 +0000
reviewerswhimboo
bugs1410652
milestone58.0a1
Bug 1410652 - Fix various API documentation in element module. r=whimboo MozReview-Commit-ID: AaGnolglX5n
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -90,18 +90,18 @@ element.Strategy = {
   Anon: "anon",
   AnonAttribute: "anon attribute",
 };
 
 /**
  * Stores known/seen elements and their associated web element
  * references.
  *
- * Elements are added by calling |add(el)| or |addAll(elements)|, and
- * may be queried by their web element reference using |get(element)|.
+ * Elements are added by calling {@link #add()} or {@link addAll()},
+ * and may be queried by their web element reference using {@link get()}.
  *
  * @class
  * @memberof element
  */
 element.Store = class {
   constructor() {
     this.els = {};
     this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
@@ -117,17 +117,17 @@ element.Store = class {
    * The oder of the returned web element references is guaranteed to
    * match that of the collection passed in.
    *
    * @param {NodeList} els
    *     Sequence of elements to add to set of seen elements.
    *
    * @return {Array.<WebElement>}
    *     List of the web element references associated with each element
-   *     from |els|.
+   *     from <var>els</var>.
    */
   addAll(els) {
     let add = this.add.bind(this);
     return [...els].map(add);
   }
 
   /**
    * Make an element seen.
@@ -253,21 +253,21 @@ element.Store = class {
   }
 };
 
 /**
  * Find a single element or a collection of elements starting at the
  * document root or a given node.
  *
  * If |timeout| is above 0, an implicit search technique is used.
- * This will wait for the duration of |timeout| for the element
- * to appear in the DOM.
+ * This will wait for the duration of <var>timeout</var> for the
+ * element to appear in the DOM.
  *
- * See the |element.Strategy| enum for a full list of supported
- * search strategies that can be passed to |strategy|.
+ * See the {@link element.Strategy} enum for a full list of supported
+ * search strategies that can be passed to <var>strategy</var>.
  *
  * Available flags for <var>opts</var>:
  *
  * <dl>
  *   <dt><code>all</code>
  *   <dd>
  *     If true, a multi-element search selector is used and a sequence
  *     of elements will be returned.  Otherwise a single element.
@@ -771,17 +771,17 @@ element.isSelected = function(el) {
  * @param {number=} yOffset
  *     Vertical offset relative to target's top-left corner.  Defaults to
  *     the centre of the target's bounding box.
  *
  * @return {Object.<string, number>}
  *     X- and Y coordinates.
  *
  * @throws TypeError
- *     If |xOffset| or |yOffset| are not numbers.
+ *     If <var>xOffset</var> or <var>yOffset</var> are not numbers.
  */
 element.coordinates = function(
     node, xOffset = undefined, yOffset = undefined) {
 
   let box = node.getBoundingClientRect();
 
   if (typeof xOffset == "undefined" || xOffset === null) {
     xOffset = box.width / 2.0;
@@ -808,17 +808,17 @@ element.coordinates = function(
  * @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.
+ *     True if if <var>el</var> is in viewport, false otherwise.
  */
 element.inViewport = function(el, x = undefined, y = undefined) {
   let win = el.ownerGlobal;
   let c = element.coordinates(el, x, y);
   let vp = {
     top: win.pageYOffset,
     left: win.pageXOffset,
     bottom: (win.pageYOffset + win.innerHeight),