B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Process each rule in this stylesheet using your callback function. Your
   * function receives one argument: the CssRule object for each CSSStyleRule
   * inside the stylesheet.
   *
   * Note that this method also iterates through @media rules inside the
   * stylesheet.
   *
   * @param {function} aCallback the function you want to execute for each of
   * the style rules.
   * @param {object} aScope the scope you want for the callback function. aScope
   * will be the this object when aCallback executes.
   */
Process each rule in this stylesheet using your callback function. Your
function receives one argument: the CssRule object for each CSSStyleRule
inside the stylesheet.

Note that this method also iterates through @media rules inside the
stylesheet.

@param {function} aCallback the function you want to execute for each of
the style rules.
@param {object} aScope the scope you want for the callback function. aScope
will be the this object when aCallback executes.
Process each rule in this stylesheet using your callback function . Your function receives one argument : the CssRule object for each CSSStyleRule inside the stylesheet . Note that this method also iterates through @media rules inside the stylesheet . @param { function } aCallback the function you want to execute for each of the style rules . @param { object } aScope the scope you want for the callback function . aScope will be the this object when aCallback executes .
function CssSheet_forEachRule(aCallback, aScope)
  {
    let ruleCount = 0;
    let domRules = this.domSheet.cssRules;
    function _iterator(aDomRule) {
      if (aDomRule.type == Ci.nsIDOMCSSRule.STYLE_RULE) {
        aCallback.call(aScope, this.getRule(aDomRule));
        ruleCount++;
      } else if (aDomRule.type == Ci.nsIDOMCSSRule.MEDIA_RULE &&
          aDomRule.cssRules && this._cssLogic.mediaMatches(aDomRule)) {
        Array.prototype.forEach.call(aDomRule.cssRules, _iterator, this);
      }
    }
    Array.prototype.forEach.call(domRules, _iterator, this);
    this._ruleCount = ruleCount;
  }
function CssSheet_forEachRule ( aCallback , aScope ) { let ruleCount = 0 ; let domRules = this . domSheet . cssRules ; function _iterator ( aDomRule ) { if ( aDomRule . type == Ci . nsIDOMCSSRule . STYLE_RULE ) { aCallback . call ( aScope , this . getRule ( aDomRule ) ) ; ruleCount ++ ; } else if ( aDomRule . type == Ci . nsIDOMCSSRule . MEDIA_RULE && aDomRule . cssRules && this . _cssLogic . mediaMatches ( aDomRule ) ) { Array . prototype . forEach . call ( aDomRule . cssRules , _iterator , this ) ; } } Array . prototype . forEach . call ( domRules , _iterator , this ) ; this . _ruleCount = ruleCount ; }
Process each rule in this stylesheet using your callback function.
Process each rule in this stylesheet using your callback function .