B2G/gecko/browser/devtools/layoutview/LayoutView.jsm
/**
   * Compute the dimensions of the node and update the values in
   * the layoutview/view.xhtml document.
   */
Compute the dimensions of the node and update the values in
the layoutview/view.xhtml document.
Compute the dimensions of the node and update the values in the layoutview / view . xhtml document .
function LV_update() {
    let node = this.inspector.selection;
    if (!node ||
        !LayoutHelpers.isNodeConnected(node) ||
        !this.documentReady) {
      return;
    }
    let clientRect = node.getBoundingClientRect();
    let width = Math.round(clientRect.width);
    let height = Math.round(clientRect.height);
    let newLabel = width + "x" + height;
    if (this.sizeHeadingLabel.textContent != newLabel) {
      this.sizeHeadingLabel.textContent = newLabel;
    }
    if (!this.isOpen) return;
    let style = this.browser.contentWindow.getComputedStyle(node);;
    for (let i in this.map) {
      let property = this.map[i].property;
      this.map[i].value = parseInt(style.getPropertyValue(property));
    }
    let margins = this.processMargins(node);
    if ("top" in margins) this.map.marginTop.value = "auto";
    if ("right" in margins) this.map.marginRight.value = "auto";
    if ("bottom" in margins) this.map.marginBottom.value = "auto";
    if ("left" in margins) this.map.marginLeft.value = "auto";
    for (let i in this.map) {
      let selector = this.map[i].selector;
      let span = this.doc.querySelector(selector);
      if (span.textContent.length > 0 &&
          span.textContent == this.map[i].value) {
        continue;
      }
      span.textContent = this.map[i].value;
    }
    width -= this.map.borderLeft.value + this.map.borderRight.value +
             this.map.paddingLeft.value + this.map.paddingRight.value;
    height -= this.map.borderTop.value + this.map.borderBottom.value +
              this.map.paddingTop.value + this.map.paddingBottom.value;
    let newValue = width + "x" + height;
    if (this.sizeLabel.textContent != newValue) {
      this.sizeLabel.textContent = newValue;
    }
  }
function LV_update ( ) { let node = this . inspector . selection ; if ( ! node || ! LayoutHelpers . isNodeConnected ( node ) || ! this . documentReady ) { return ; } let clientRect = node . getBoundingClientRect ( ) ; let width = Math . round ( clientRect . width ) ; let height = Math . round ( clientRect . height ) ; let newLabel = width + "x" + height ; if ( this . sizeHeadingLabel . textContent != newLabel ) { this . sizeHeadingLabel . textContent = newLabel ; } if ( ! this . isOpen ) return ; let style = this . browser . contentWindow . getComputedStyle ( node ) ; ; for ( let i in this . map ) { let property = this . map [ i ] . property ; this . map [ i ] . value = parseInt ( style . getPropertyValue ( property ) ) ; } let margins = this . processMargins ( node ) ; if ( "top" in margins ) this . map . marginTop . value = "auto" ; if ( "right" in margins ) this . map . marginRight . value = "auto" ; if ( "bottom" in margins ) this . map . marginBottom . value = "auto" ; if ( "left" in margins ) this . map . marginLeft . value = "auto" ; for ( let i in this . map ) { let selector = this . map [ i ] . selector ; let span = this . doc . querySelector ( selector ) ; if ( span . textContent . length > 0 && span . textContent == this . map [ i ] . value ) { continue ; } span . textContent = this . map [ i ] . value ; } width -= this . map . borderLeft . value + this . map . borderRight . value + this . map . paddingLeft . value + this . map . paddingRight . value ; height -= this . map . borderTop . value + this . map . borderBottom . value + this . map . paddingTop . value + this . map . paddingBottom . value ; let newValue = width + "x" + height ; if ( this . sizeLabel . textContent != newValue ) { this . sizeLabel . textContent = newValue ; } }
Compute the dimensions of the node and update the values in
 the layoutview/view.xhtml document.
Compute the dimensions of the node and update the values in the layoutview / view . xhtml document .
// First, we update the first part of the layout view, with // the size of the element. // If the view is closed, no need to do anything more. // We compute and update the values of margins & co.