B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
 * A class that holds information about a given CssSelector object.
 *
 * Instances of this class are given to CssHtmlTree in the arrays of matched and
 * unmatched selectors. Each such object represents a displayable row in the
 * PropertyView objects. The information given by this object blends data coming
 * from the CssSheet, CssRule and from the CssSelector that own this object.
 *
 * @param {CssSelector} aSelector The CssSelector object for which to present information.
 * @param {string} aProperty The property for which information should be retrieved.
 * @param {string} aValue The property value from the CssRule that owns the selector.
 * @param {CssLogic.STATUS} aStatus The selector match status.
 * @constructor
 */
A class that holds information about a given CssSelector object.
Instances of this class are given to CssHtmlTree in the arrays of matched and
unmatched selectors. Each such object represents a displayable row in the
PropertyView objects. The information given by this object blends data coming
from the CssSheet, CssRule and from the CssSelector that own this object.

@param {CssSelector} aSelector The CssSelector object for which to present information.
@param {string} aProperty The property for which information should be retrieved.
@param {string} aValue The property value from the CssRule that owns the selector.
@param {CssLogic.STATUS} aStatus The selector match status.
@constructor
A class that holds information about a given CssSelector object . Instances of this class are given to CssHtmlTree in the arrays of matched and unmatched selectors . Each such object represents a displayable row in the PropertyView objects . The information given by this object blends data coming from the CssSheet CssRule and from the CssSelector that own this object . @param { CssSelector } aSelector The CssSelector object for which to present information . @param { string } aProperty The property for which information should be retrieved . @param { string } aValue The property value from the CssRule that owns the selector . @param { CssLogic . STATUS } aStatus The selector match status . @constructor
function CssSelectorInfo(aSelector, aProperty, aValue, aStatus)
{
  this.selector = aSelector;
  this.property = aProperty;
  this.value = aValue;
  this.status = aStatus;
  let priority = this.selector._cssRule.getPropertyPriority(this.property);
  this.important = (priority === "important");
  let scorePrefix = this.contentRule ? 2 : 0;
  if (this.elementStyle) {
    scorePrefix++;
  }
  if (this.important) {
    scorePrefix += this.contentRule ? 2 : 1;
  }
  this.specificityScore = "" + scorePrefix + this.specificity.ids +
      this.specificity.classes + this.specificity.tags;
}
function CssSelectorInfo ( aSelector , aProperty , aValue , aStatus ) { this . selector = aSelector ; this . property = aProperty ; this . value = aValue ; this . status = aStatus ; let priority = this . selector . _cssRule . getPropertyPriority ( this . property ) ; this . important = ( priority === "important" ) ; let scorePrefix = this . contentRule ? 2 : 0 ; if ( this . elementStyle ) { scorePrefix ++ ; } if ( this . important ) { scorePrefix += this . contentRule ? 2 : 1 ; } this . specificityScore = "" + scorePrefix + this . specificity . ids + this . specificity . classes + this . specificity . tags ; }
A class that holds information about a given CssSelector object.
A class that holds information about a given CssSelector object .
/* Score prefix:
  0 UA normal property
  1 UA important property
  2 normal property
  3 inline (element.style)
  4 important
  5 inline important
  */