B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Process the CssSelector objects that match the highlighted element and its
   * parent elements. aScope.aCallback() is executed for each CssSelector
   * object, being passed the CssSelector object and the match status.
   *
   * This method also includes all of the element.style properties, for each
   * highlighted element parent and for the highlighted element itself.
   *
   * Note that the matched selectors are cached, such that next time your
   * callback is invoked for the cached list of CssSelector objects.
   *
   * @param {function} aCallback the function you want to execute for each of
   * the matched selectors.
   * @param {object} aScope the scope you want for the callback function. aScope
   * will be the this object when aCallback executes.
   */
Process the CssSelector objects that match the highlighted element and its
parent elements. aScope.aCallback() is executed for each CssSelector
object, being passed the CssSelector object and the match status.

This method also includes all of the element.style properties, for each
highlighted element parent and for the highlighted element itself.

Note that the matched selectors are cached, such that next time your
callback is invoked for the cached list of CssSelector objects.

@param {function} aCallback the function you want to execute for each of
the matched selectors.
@param {object} aScope the scope you want for the callback function. aScope
will be the this object when aCallback executes.
Process the CssSelector objects that match the highlighted element and its parent elements . aScope . aCallback () is executed for each CssSelector object being passed the CssSelector object and the match status . This method also includes all of the element . style properties for each highlighted element parent and for the highlighted element itself . Note that the matched selectors are cached such that next time your callback is invoked for the cached list of CssSelector objects . @param { function } aCallback the function you want to execute for each of the matched selectors . @param { object } aScope the scope you want for the callback function . aScope will be the this object when aCallback executes .
function CL_processMatchedSelectors(aCallback, aScope)
  {
    if (this._matchedSelectors) {
      if (aCallback) {
        this._passId++;
        this._matchedSelectors.forEach(function(aValue) {
          aCallback.call(aScope, aValue[0], aValue[1]);
          aValue[0]._cssRule._passId = this._passId;
        }, this);
      }
      return;
    }
    if (!this._matchedRules) {
      this._buildMatchedRules();
    }
    this._matchedSelectors = [];
    this._unmatchedSelectors = null;
    this._passId++;
    for (let i = 0; i < this._matchedRules.length; i++) {
      let rule = this._matchedRules[i][0];
      let status = this._matchedRules[i][1];
      rule.selectors.forEach(function (aSelector) {
        if (aSelector._matchId !== this._matchId &&
            (aSelector.elementStyle ||
             this._selectorMatchesElement(aSelector))) {
          aSelector._matchId = this._matchId;
          this._matchedSelectors.push([ aSelector, status ]);
          if (aCallback) {
            aCallback.call(aScope, aSelector, status);
          }
        }
      }, this);
      rule._passId = this._passId;
    }
  }
function CL_processMatchedSelectors ( aCallback , aScope ) { if ( this . _matchedSelectors ) { if ( aCallback ) { this . _passId ++ ; this . _matchedSelectors . forEach ( function ( aValue ) { aCallback . call ( aScope , aValue [ 0 ] , aValue [ 1 ] ) ; aValue [ 0 ] . _cssRule . _passId = this . _passId ; } , this ) ; } return ; } if ( ! this . _matchedRules ) { this . _buildMatchedRules ( ) ; } this . _matchedSelectors = [ ] ; this . _unmatchedSelectors = null ; this . _passId ++ ; for ( let i = 0 ; i < this . _matchedRules . length ; i ++ ) { let rule = this . _matchedRules [ i ] [ 0 ] ; let status = this . _matchedRules [ i ] [ 1 ] ; rule . selectors . forEach ( function ( aSelector ) { if ( aSelector . _matchId !== this . _matchId && ( aSelector . elementStyle || this . _selectorMatchesElement ( aSelector ) ) ) { aSelector . _matchId = this . _matchId ; this . _matchedSelectors . push ( [ aSelector , status ] ) ; if ( aCallback ) { aCallback . call ( aScope , aSelector , status ) ; } } } , this ) ; rule . _passId = this . _passId ; } }
Process the CssSelector objects that match the highlighted element and its
 parent elements.
Process the CssSelector objects that match the highlighted element and its parent elements .