B2G/gecko/accessible/tests/mochitest/events.js
/**
   * Log message to DOM.
   *
   * @param aMsg          [in] the primary message
   * @param aHasIndent    [in, optional] if specified the message has an indent
   * @param aPreEmphText  [in, optional] the text is colored and appended prior
   *                        primary message
   */
Log message to DOM.
@param aMsg          [in] the primary message
@param aHasIndent    [in, optional] if specified the message has an indent
@param aPreEmphText  [in, optional] the text is colored and appended prior
primary message
Log message to DOM . @param aMsg [ in ] the primary message @param aHasIndent [ in optional ] if specified the message has an indent @param aPreEmphText [ in optional ] the text is colored and appended prior primary message
function logger_logToDOM(aMsg, aHasIndent, aPreEmphText)
  {
    if (gA11yEventDumpID == "")
      return;
    var dumpElm = document.getElementById(gA11yEventDumpID);
    if (!dumpElm) {
      ok(false,
         "No dump element '" + gA11yEventDumpID + "' within the document!");
      return;
    }
    var containerTagName = document instanceof nsIDOMHTMLDocument ?
      "div" : "description";
    var container = document.createElement(containerTagName);
    if (aHasIndent)
      container.setAttribute("style", "padding-left: 10px;");
    if (aPreEmphText) {
      var inlineTagName = document instanceof nsIDOMHTMLDocument ?
        "span" : "description";
      var emphElm = document.createElement(inlineTagName);
      emphElm.setAttribute("style", "color: blue;");
      emphElm.textContent = aPreEmphText;
      container.appendChild(emphElm);
    }
    var textNode = document.createTextNode(aMsg);
    container.appendChild(textNode);
    dumpElm.appendChild(container);
  }
function logger_logToDOM ( aMsg , aHasIndent , aPreEmphText ) { if ( gA11yEventDumpID == "" ) return ; var dumpElm = document . getElementById ( gA11yEventDumpID ) ; if ( ! dumpElm ) { ok ( false , "No dump element '" + gA11yEventDumpID + "' within the document!" ) ; return ; } var containerTagName = document instanceof nsIDOMHTMLDocument ? "div" : "description" ; var container = document . createElement ( containerTagName ) ; if ( aHasIndent ) container . setAttribute ( "style" , "padding-left: 10px;" ) ; if ( aPreEmphText ) { var inlineTagName = document instanceof nsIDOMHTMLDocument ? "span" : "description" ; var emphElm = document . createElement ( inlineTagName ) ; emphElm . setAttribute ( "style" , "color: blue;" ) ; emphElm . textContent = aPreEmphText ; container . appendChild ( emphElm ) ; } var textNode = document . createTextNode ( aMsg ) ; container . appendChild ( textNode ) ; dumpElm . appendChild ( container ) ; }
Log message to DOM.
Log message to DOM .