B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Find the selectors that match the highlighted element and its parents.
   * Uses CssLogic.processMatchedSelectors() to find the matched selectors,
   * passing in a reference to CssPropertyInfo._processMatchedSelector() to
   * create CssSelectorInfo objects, which we then sort
   * @private
   */
Find the selectors that match the highlighted element and its parents.
Uses CssLogic.processMatchedSelectors() to find the matched selectors,
passing in a reference to CssPropertyInfo._processMatchedSelector() to
create CssSelectorInfo objects, which we then sort
@private
Find the selectors that match the highlighted element and its parents . Uses CssLogic . processMatchedSelectors () to find the matched selectors passing in a reference to CssPropertyInfo . _processMatchedSelector () to create CssSelectorInfo objects which we then sort @private
function CssPropertyInfo_findMatchedSelectors()
  {
    this._matchedSelectors = [];
    this._matchedRuleCount = 0;
    this.needRefilter = false;
    this._cssLogic.processMatchedSelectors(this._processMatchedSelector, this);
    this._matchedSelectors.sort(function(aSelectorInfo1, aSelectorInfo2) {
      if (aSelectorInfo1.status > aSelectorInfo2.status) {
        return -1;
      } else if (aSelectorInfo2.status > aSelectorInfo1.status) {
        return 1;
      } else {
        return aSelectorInfo1.compareTo(aSelectorInfo2);
      }
    });
    if (this._matchedSelectors.length > 0 &&
        this._matchedSelectors[0].status > CssLogic.STATUS.UNMATCHED) {
      this._matchedSelectors[0].status = CssLogic.STATUS.BEST;
    }
  }
function CssPropertyInfo_findMatchedSelectors ( ) { this . _matchedSelectors = [ ] ; this . _matchedRuleCount = 0 ; this . needRefilter = false ; this . _cssLogic . processMatchedSelectors ( this . _processMatchedSelector , this ) ; this . _matchedSelectors . sort ( function ( aSelectorInfo1 , aSelectorInfo2 ) { if ( aSelectorInfo1 . status > aSelectorInfo2 . status ) { return - 1 ; } else if ( aSelectorInfo2 . status > aSelectorInfo1 . status ) { return 1 ; } else { return aSelectorInfo1 . compareTo ( aSelectorInfo2 ) ; } } ) ; if ( this . _matchedSelectors . length > 0 && this . _matchedSelectors [ 0 ] . status > CssLogic . STATUS . UNMATCHED ) { this . _matchedSelectors [ 0 ] . status = CssLogic . STATUS . BEST ; } }
Find the selectors that match the highlighted element and its parents.
Find the selectors that match the highlighted element and its parents .
// Sort the selectors by how well they match the given element. // Now we know which of the matches is best, we can mark it BEST_MATCH.