B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
 * A single style rule or declaration.
 *
 * @param {ElementStyle} aElementStyle
 *        The ElementStyle to which this rule belongs.
 * @param {object} aOptions
 *        The information used to construct this rule.  Properties include:
 *          domRule: the nsIDOMCSSStyleRule to view, if any.
 *          style: the nsIDOMCSSStyleDeclaration to view.  If omitted,
 *            the domRule's style will be used.
 *          selectorText: selector text to display.  If omitted, the domRule's
 *            selectorText will be used.
 *          inherited: An element this rule was inherited from.  If omitted,
 *            the rule applies directly to the current element.
 * @constructor
 */
A single style rule or declaration.
@param {ElementStyle} aElementStyle
The ElementStyle to which this rule belongs.
@param {object} aOptions
The information used to construct this rule.  Properties include:
domRule: the nsIDOMCSSStyleRule to view, if any.
style: the nsIDOMCSSStyleDeclaration to view.  If omitted,
the domRule's style will be used.
selectorText: selector text to display.  If omitted, the domRule's
selectorText will be used.
inherited: An element this rule was inherited from.  If omitted,
the rule applies directly to the current element.
@constructor
A single style rule or declaration . @param { ElementStyle } aElementStyle The ElementStyle to which this rule belongs . @param { object } aOptions The information used to construct this rule . Properties include : domRule : the nsIDOMCSSStyleRule to view if any . style : the nsIDOMCSSStyleDeclaration to view . If omitted the domRule ' s style will be used . selectorText : selector text to display . If omitted the domRule ' s selectorText will be used . inherited : An element this rule was inherited from . If omitted the rule applies directly to the current element . @constructor
function Rule(aElementStyle, aOptions)
{
  this.elementStyle = aElementStyle;
  this.domRule = aOptions.domRule || null;
  this.style = aOptions.style || this.domRule.style;
  this.selectorText = aOptions.selectorText || this.domRule.selectorText;
  this.inherited = aOptions.inherited || null;
  if (this.domRule) {
    let parentRule = this.domRule.parentRule;
    if (parentRule && parentRule.type == Ci.nsIDOMCSSRule.MEDIA_RULE) {
      this.mediaText = parentRule.media.mediaText;
    }
  }
  this.textProps = this._getTextProperties();
  this.textProps = this.textProps.concat(this._getDisabledProperties());
}
function Rule ( aElementStyle , aOptions ) { this . elementStyle = aElementStyle ; this . domRule = aOptions . domRule || null ; this . style = aOptions . style || this . domRule . style ; this . selectorText = aOptions . selectorText || this . domRule . selectorText ; this . inherited = aOptions . inherited || null ; if ( this . domRule ) { let parentRule = this . domRule . parentRule ; if ( parentRule && parentRule . type == Ci . nsIDOMCSSRule . MEDIA_RULE ) { this . mediaText = parentRule . media . mediaText ; } } this . textProps = this . _getTextProperties ( ) ; this . textProps = this . textProps . concat ( this . _getDisabledProperties ( ) ) ; }
A single style rule or declaration.
A single style rule or declaration .
// Populate the text properties with the style's current cssText // value, and add in any disabled properties from the store.