B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
   * Keeps the editor close to the size of its input string.  This is pretty
   * crappy, suggestions for improvement welcome.
   */
Keeps the editor close to the size of its input string.  This is pretty
crappy, suggestions for improvement welcome.
Keeps the editor close to the size of its input string . This is pretty crappy suggestions for improvement welcome .
function InplaceEditor_autosize()
  {
    this._measurement = this.doc.createElementNS(HTML_NS, this.multiline ? "pre" : "span");
    this._measurement.className = "autosizer";
    this.elt.parentNode.appendChild(this._measurement);
    let style = this._measurement.style;
    style.visibility = "hidden";
    style.position = "absolute";
    style.top = "0";
    style.left = "0";
    copyTextStyles(this.input, this._measurement);
    this._updateSize();
  }
function InplaceEditor_autosize ( ) { this . _measurement = this . doc . createElementNS ( HTML_NS , this . multiline ? "pre" : "span" ) ; this . _measurement . className = "autosizer" ; this . elt . parentNode . appendChild ( this . _measurement ) ; let style = this . _measurement . style ; style . visibility = "hidden" ; style . position = "absolute" ; style . top = "0" ; style . left = "0" ; copyTextStyles ( this . input , this . _measurement ) ; this . _updateSize ( ) ; }
Keeps the editor close to the size of its input string.
Keeps the editor close to the size of its input string .
// Create a hidden, absolutely-positioned span to measure the text // in the input.  Boo. // We can't just measure the original element because a) we don't // change the underlying element's text ourselves (we leave that // up to the client), and b) without tweaking the style of the // original element, it might wrap differently or something.