B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Cache a stylesheet if it falls within the requirements: if it's enabled,
   * and if the @media is allowed. This method also walks through the stylesheet
   * cssRules to find @imported rules, to cache the stylesheets of those rules
   * as well.
   *
   * @private
   * @param {CSSStyleSheet} aDomSheet the CSSStyleSheet object to cache.
   */
Cache a stylesheet if it falls within the requirements: if it's enabled,
and if the @media is allowed. This method also walks through the stylesheet
cssRules to find @imported rules, to cache the stylesheets of those rules
as well.


Cache a stylesheet if it falls within the requirements : if it ' s enabled and if the @media is allowed . This method also walks through the stylesheet cssRules to find @imported rules to cache the stylesheets of those rules as well .
function CssLogic_cacheSheet(aDomSheet)
  {
    if (aDomSheet.disabled) {
      return;
    }
    if (!this.mediaMatches(aDomSheet)) {
      return;
    }
    let cssSheet = this.getSheet(aDomSheet, this._sheetIndex++);
    if (cssSheet._passId != this._passId) {
      cssSheet._passId = this._passId;
      Array.prototype.forEach.call(aDomSheet.cssRules, function(aDomRule) {
        if (aDomRule.type == Ci.nsIDOMCSSRule.IMPORT_RULE && aDomRule.styleSheet &&
            this.mediaMatches(aDomRule)) {
          this._cacheSheet(aDomRule.styleSheet);
        }
      }, this);
    }
  }
function CssLogic_cacheSheet ( aDomSheet ) { if ( aDomSheet . disabled ) { return ; } if ( ! this . mediaMatches ( aDomSheet ) ) { return ; } let cssSheet = this . getSheet ( aDomSheet , this . _sheetIndex ++ ) ; if ( cssSheet . _passId != this . _passId ) { cssSheet . _passId = this . _passId ; Array . prototype . forEach . call ( aDomSheet . cssRules , function ( aDomRule ) { if ( aDomRule . type == Ci . nsIDOMCSSRule . IMPORT_RULE && aDomRule . styleSheet && this . mediaMatches ( aDomRule ) ) { this . _cacheSheet ( aDomRule . styleSheet ) ; } } , this ) ; } }
Cache a stylesheet if it falls within the requirements: if it's enabled,
 and if the @media is allowed.
Cache a stylesheet if it falls within the requirements : if it ' s enabled and if the @media is allowed .
// Only work with stylesheets that have their media allowed. // Cache the sheet. // Find import rules.