B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
   * Size the editor to fit its current contents.
   */
Size the editor to fit its current contents.
Size the editor to fit its current contents .
function InplaceEditor_updateSize()
  {
    this._measurement.textContent = this.input.value.replace(/ /g, '\u00a0');
    let width = this._measurement.offsetWidth + 10;
    if (this.multiline) {
      width += 15;
      this._measurement.textContent += "M";
      this.input.style.height = this._measurement.offsetHeight + "px";
    }
    this.input.style.width = width + "px";
  }
function InplaceEditor_updateSize ( ) { this . _measurement . textContent = this . input . value . replace ( / / g , '\u00a0' ) ; let width = this . _measurement . offsetWidth + 10 ; if ( this . multiline ) { width += 15 ; this . _measurement . textContent += "M" ; this . input . style . height = this . _measurement . offsetHeight + "px" ; } this . input . style . width = width + "px" ; }
Size the editor to fit its current contents.
Size the editor to fit its current contents .
// Replace spaces with non-breaking spaces.  Otherwise setting // the span's textContent will collapse spaces and the measurement // will be wrong. // We add a bit of padding to the end.  Should be enough to fit // any letter that could be typed, otherwise we'll scroll before // we get a chance to resize.  Yuck. // Make sure there's some content in the current line.  This is a hack to account // for the fact that after adding a newline the <pre> doesn't grow unless there's // text content on the line.