B2G/gecko/testing/marionette/marionette-server.js
/**
   * Get the text of an element, if any. Includes the text of all child elements.
   *
   * @param object aRequest
   *        'element' member holds the reference id to
   *        the element that will be inspected 
   */
Get the text of an element, if any. Includes the text of all child elements.
@param object aRequest
'element' member holds the reference id to
the element that will be inspected
Get the text of an element if any . Includes the text of all child elements . @param object aRequest ' element ' member holds the reference id to the element that will be inspected
function MDA_getElementText(aRequest) {
    let command_id = this.command_id = this.getCommandId();
    if (this.context == "chrome") {
      try {
        let el = this.curBrowser.elementManager.getKnownElement(
            aRequest.element, this.getCurrentWindow());
        let lines = [];
        this.getVisibleText(el, lines);
        lines = lines.join("\n");
        this.sendResponse(lines, command_id);
      }
      catch (e) {
        this.sendError(e.message, e.code, e.stack, command_id);
      }
    }
    else {
      this.sendAsync("getElementText",
                     { element: aRequest.element },
                     command_id);
    }
  }
function MDA_getElementText ( aRequest ) { let command_id = this . command_id = this . getCommandId ( ) ; if ( this . context == "chrome" ) { try { let el = this . curBrowser . elementManager . getKnownElement ( aRequest . element , this . getCurrentWindow ( ) ) ; let lines = [ ] ; this . getVisibleText ( el , lines ) ; lines = lines . join ( "\n" ) ; this . sendResponse ( lines , command_id ) ; } catch ( e ) { this . sendError ( e . message , e . code , e . stack , command_id ) ; } } else { this . sendAsync ( "getElementText" , { element : aRequest . element } , command_id ) ; } }
Get the text of an element, if any.
Get the text of an element if any .
//Note: for chrome, we look at text nodes, and any node with a "label" field