B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
 * ElementStyle maintains a list of Rule objects for a given element.
 *
 * @param Element aElement
 *        The element whose style we are viewing.
 * @param object aStore
 *        The ElementStyle can use this object to store metadata
 *        that might outlast the rule view, particularly the current
 *        set of disabled properties.
 *
 * @constructor
 */
ElementStyle maintains a list of Rule objects for a given element.
@param Element aElement
The element whose style we are viewing.
@param object aStore
The ElementStyle can use this object to store metadata
that might outlast the rule view, particularly the current
set of disabled properties.

@constructor
ElementStyle maintains a list of Rule objects for a given element . @param Element aElement The element whose style we are viewing . @param object aStore The ElementStyle can use this object to store metadata that might outlast the rule view particularly the current set of disabled properties . @constructor
function ElementStyle(aElement, aStore)
{
  this.element = aElement;
  this.store = aStore || {};
  if (!("userProperties" in this.store)) {
    this.store.userProperties = new UserProperties();
  }
  if (this.store.disabled) {
    this.store.disabled = aStore.disabled;
  } else {
    this.store.disabled = new Map();
  }
  let doc = aElement.ownerDocument;
  this.dummyElement = doc.createElementNS(this.element.namespaceURI,
                                          this.element.tagName);
  this.populate();
}
function ElementStyle ( aElement , aStore ) { this . element = aElement ; this . store = aStore || { } ; if ( ! ( "userProperties" in this . store ) ) { this . store . userProperties = new UserProperties ( ) ; } if ( this . store . disabled ) { this . store . disabled = aStore . disabled ; } else { this . store . disabled = new Map ( ) ; } let doc = aElement . ownerDocument ; this . dummyElement = doc . createElementNS ( this . element . namespaceURI , this . element . tagName ) ; this . populate ( ) ; }
ElementStyle maintains a list of Rule objects for a given element.
ElementStyle maintains a list of Rule objects for a given element .
// We don't want to overwrite this.store.userProperties so we only create it // if it doesn't already exist. // FIXME: This should be a WeakMap once bug 753517 is fixed. // See Bug 777373 for details. // To figure out how shorthand properties are interpreted by the // engine, we will set properties on a dummy element and observe // how their .style attribute reflects them as computed values.