B2G/gecko/testing/marionette/marionette-server.js
/**
   * Recursively get all labeled text
   *
   * @param nsIDOMElement el
   *        The parent element
   * @param array lines
   *        Array that holds the text lines
   */
Recursively get all labeled text
@param nsIDOMElement el
The parent element
@param array lines
Array that holds the text lines
Recursively get all labeled text @param nsIDOMElement el The parent element @param array lines Array that holds the text lines
function MDA_getVisibleText(el, lines) {
    let nodeName = el.nodeName;
    try {
      if (utils.isElementDisplayed(el)) {
        if (el.value) {
          lines.push(el.value);
        }
        for (var child in el.childNodes) {
          this.getVisibleText(el.childNodes[child], lines);
        };
      }
    }
    catch (e) {
      if (nodeName == "#text") {
        lines.push(el.textContent);
      }
    }
  }
function MDA_getVisibleText ( el , lines ) { let nodeName = el . nodeName ; try { if ( utils . isElementDisplayed ( el ) ) { if ( el . value ) { lines . push ( el . value ) ; } for ( var child in el . childNodes ) { this . getVisibleText ( el . childNodes [ child ] , lines ) ; } ; } } catch ( e ) { if ( nodeName == "#text" ) { lines . push ( el . textContent ) ; } } }
Recursively get all labeled text
 @param nsIDOMElement el
        The parent element
 @param array lines
        Array that holds the text lines
Recursively get all labeled text @param nsIDOMElement el The parent element @param array lines Array that holds the text lines