B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Focus on a new element - remove the style caches.
   *
   * @param {nsIDOMElement} aViewedElement the element the user has highlighted
   * in the Inspector.
   */
Focus on a new element - remove the style caches.
@param {nsIDOMElement} aViewedElement the element the user has highlighted
in the Inspector.
Focus on a new element - remove the style caches . @param { nsIDOMElement } aViewedElement the element the user has highlighted in the Inspector .
function CssLogic_highlight(aViewedElement)
  {
    if (!aViewedElement) {
      this.viewedElement = null;
      this.viewedDocument = null;
      this._computedStyle = null;
      this.reset();
      return;
    }
    this.viewedElement = aViewedElement;
    let doc = this.viewedElement.ownerDocument;
    if (doc != this.viewedDocument) {
      this.viewedDocument = doc;
      this._cacheSheets();
    } else {
      this._propertyInfos = {};
    }
    this._matchedRules = null;
    this._matchedSelectors = null;
    this._unmatchedSelectors = null;
    let win = this.viewedDocument.defaultView;
    this._computedStyle = win.getComputedStyle(this.viewedElement, "");
  }
function CssLogic_highlight ( aViewedElement ) { if ( ! aViewedElement ) { this . viewedElement = null ; this . viewedDocument = null ; this . _computedStyle = null ; this . reset ( ) ; return ; } this . viewedElement = aViewedElement ; let doc = this . viewedElement . ownerDocument ; if ( doc != this . viewedDocument ) { this . viewedDocument = doc ; this . _cacheSheets ( ) ; } else { this . _propertyInfos = { } ; } this . _matchedRules = null ; this . _matchedSelectors = null ; this . _unmatchedSelectors = null ; let win = this . viewedDocument . defaultView ; this . _computedStyle = win . getComputedStyle ( this . viewedElement , "" ) ; }
Focus on a new element - remove the style caches.
Focus on a new element - remove the style caches .
// New document: clear/rebuild the cache. // Hunt down top level stylesheets, and cache them. // Clear cached data in the CssPropertyInfo objects.