B2G/gecko/accessible/tests/mochitest/common.js
/**
 * Return pretty name for identifier, it may be ID, DOM node or accessible.
 */
Return pretty name for identifier, it may be ID, DOM node or accessible.
Return pretty name for identifier it may be ID DOM node or accessible .
function prettyName(aIdentifier)
{
  if (aIdentifier instanceof nsIAccessible) {
    var acc = getAccessible(aIdentifier);
    var msg = "[" + getNodePrettyName(acc.DOMNode);
    try {
      msg += ", role: " + roleToString(acc.role);
      if (acc.name)
        msg += ", name: '" + acc.name + "'";
    } catch (e) {
      msg += "defunct";
    }
    if (acc)
      msg += ", address: " + getObjAddress(acc);
    msg += "]";
    return msg;
  }
  if (aIdentifier instanceof nsIDOMNode)
    return "[ " + getNodePrettyName(aIdentifier) + " ]";
  return " '" + aIdentifier + "' ";
}
function prettyName ( aIdentifier ) { if ( aIdentifier instanceof nsIAccessible ) { var acc = getAccessible ( aIdentifier ) ; var msg = "[" + getNodePrettyName ( acc . DOMNode ) ; try { msg += ", role: " + roleToString ( acc . role ) ; if ( acc . name ) msg += ", name: '" + acc . name + "'" ; } catch ( e ) { msg += "defunct" ; } if ( acc ) msg += ", address: " + getObjAddress ( acc ) ; msg += "]" ; return msg ; } if ( aIdentifier instanceof nsIDOMNode ) return "[ " + getNodePrettyName ( aIdentifier ) + " ]" ; return " '" + aIdentifier + "' " ; }
Return pretty name for identifier, it may be ID, DOM node or accessible.
Return pretty name for identifier it may be ID DOM node or accessible .