B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Adjusts the category and severity of the given message, clearing the old
   * category and severity if present.
   *
   * @param nsIDOMNode aMessageNode
   *        The message node to alter.
   * @param number aNewCategory
   *        The new category for the message; one of the CATEGORY_ constants.
   * @param number aNewSeverity
   *        The new severity for the message; one of the SEVERITY_ constants.
   * @return void
   */
Adjusts the category and severity of the given message, clearing the old
category and severity if present.

@param nsIDOMNode aMessageNode
The message node to alter.
@param number aNewCategory
The new category for the message; one of the CATEGORY_ constants.
@param number aNewSeverity
The new severity for the message; one of the SEVERITY_ constants.
@return void
Adjusts the category and severity of the given message clearing the old category and severity if present . @param nsIDOMNode aMessageNode The message node to alter . @param number aNewCategory The new category for the message ; one of the CATEGORY_ constants . @param number aNewSeverity The new severity for the message ; one of the SEVERITY_ constants . @return void
function WCF_setMessageType(aMessageNode, aNewCategory, aNewSeverity)
  {
    if ("category" in aMessageNode) {
      let oldCategory = aMessageNode.category;
      let oldSeverity = aMessageNode.severity;
      aMessageNode.classList.remove("webconsole-msg-" +
                                    CATEGORY_CLASS_FRAGMENTS[oldCategory]);
      aMessageNode.classList.remove("webconsole-msg-" +
                                    SEVERITY_CLASS_FRAGMENTS[oldSeverity]);
      let key = "hud-" + MESSAGE_PREFERENCE_KEYS[oldCategory][oldSeverity];
      aMessageNode.classList.remove(key);
    }
    aMessageNode.category = aNewCategory;
    aMessageNode.severity = aNewSeverity;
    aMessageNode.classList.add("webconsole-msg-" +
                               CATEGORY_CLASS_FRAGMENTS[aNewCategory]);
    aMessageNode.classList.add("webconsole-msg-" +
                               SEVERITY_CLASS_FRAGMENTS[aNewSeverity]);
    let key = "hud-" + MESSAGE_PREFERENCE_KEYS[aNewCategory][aNewSeverity];
    aMessageNode.classList.add(key);
  }
function WCF_setMessageType ( aMessageNode , aNewCategory , aNewSeverity ) { if ( "category" in aMessageNode ) { let oldCategory = aMessageNode . category ; let oldSeverity = aMessageNode . severity ; aMessageNode . classList . remove ( "webconsole-msg-" + CATEGORY_CLASS_FRAGMENTS [ oldCategory ] ) ; aMessageNode . classList . remove ( "webconsole-msg-" + SEVERITY_CLASS_FRAGMENTS [ oldSeverity ] ) ; let key = "hud-" + MESSAGE_PREFERENCE_KEYS [ oldCategory ] [ oldSeverity ] ; aMessageNode . classList . remove ( key ) ; } aMessageNode . category = aNewCategory ; aMessageNode . severity = aNewSeverity ; aMessageNode . classList . add ( "webconsole-msg-" + CATEGORY_CLASS_FRAGMENTS [ aNewCategory ] ) ; aMessageNode . classList . add ( "webconsole-msg-" + SEVERITY_CLASS_FRAGMENTS [ aNewSeverity ] ) ; let key = "hud-" + MESSAGE_PREFERENCE_KEYS [ aNewCategory ] [ aNewSeverity ] ; aMessageNode . classList . add ( key ) ; }
Adjusts the category and severity of the given message, clearing the old
 category and severity if present.
Adjusts the category and severity of the given message clearing the old category and severity if present .
// Remove the old CSS classes, if applicable. // Add in the new CSS classes.