B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Compare the current CssSelectorInfo instance to another instance, based on
   * specificity information.
   *
   * @param {CssSelectorInfo} aThat The instance to compare ourselves against.
   * @return number -1, 0, 1 depending on how aThat compares with this.
   */
Compare the current CssSelectorInfo instance to another instance, based on
specificity information.

@param {CssSelectorInfo} aThat The instance to compare ourselves against.
@return number -1, 0, 1 depending on how aThat compares with this.
Compare the current CssSelectorInfo instance to another instance based on specificity information . @param { CssSelectorInfo } aThat The instance to compare ourselves against . @return number - 1 0 1 depending on how aThat compares with this .
function CssSelectorInfo_compareTo(aThat)
  {
    if (!this.contentRule && aThat.contentRule) return 1;
    if (this.contentRule && !aThat.contentRule) return -1;
    if (this.elementStyle && !aThat.elementStyle) {
      if (!this.important && aThat.important) return 1;
      else return -1;
    }
    if (!this.elementStyle && aThat.elementStyle) {
      if (this.important && !aThat.important) return -1;
      else return 1;
    }
    if (this.important && !aThat.important) return -1;
    if (aThat.important && !this.important) return 1;
    if (this.specificity.ids > aThat.specificity.ids) return -1;
    if (aThat.specificity.ids > this.specificity.ids) return 1;
    if (this.specificity.classes > aThat.specificity.classes) return -1;
    if (aThat.specificity.classes > this.specificity.classes) return 1;
    if (this.specificity.tags > aThat.specificity.tags) return -1;
    if (aThat.specificity.tags > this.specificity.tags) return 1;
    if (this.sheetIndex > aThat.sheetIndex) return -1;
    if (aThat.sheetIndex > this.sheetIndex) return 1;
    if (this.ruleLine > aThat.ruleLine) return -1;
    if (aThat.ruleLine > this.ruleLine) return 1;
    return 0;
  }
function CssSelectorInfo_compareTo ( aThat ) { if ( ! this . contentRule && aThat . contentRule ) return 1 ; if ( this . contentRule && ! aThat . contentRule ) return - 1 ; if ( this . elementStyle && ! aThat . elementStyle ) { if ( ! this . important && aThat . important ) return 1 ; else return - 1 ; } if ( ! this . elementStyle && aThat . elementStyle ) { if ( this . important && ! aThat . important ) return - 1 ; else return 1 ; } if ( this . important && ! aThat . important ) return - 1 ; if ( aThat . important && ! this . important ) return 1 ; if ( this . specificity . ids > aThat . specificity . ids ) return - 1 ; if ( aThat . specificity . ids > this . specificity . ids ) return 1 ; if ( this . specificity . classes > aThat . specificity . classes ) return - 1 ; if ( aThat . specificity . classes > this . specificity . classes ) return 1 ; if ( this . specificity . tags > aThat . specificity . tags ) return - 1 ; if ( aThat . specificity . tags > this . specificity . tags ) return 1 ; if ( this . sheetIndex > aThat . sheetIndex ) return - 1 ; if ( aThat . sheetIndex > this . sheetIndex ) return 1 ; if ( this . ruleLine > aThat . ruleLine ) return - 1 ; if ( aThat . ruleLine > this . ruleLine ) return 1 ; return 0 ; }
Compare the current CssSelectorInfo instance to another instance, based on
 specificity information.
Compare the current CssSelectorInfo instance to another instance based on specificity information .