Bug 1046803 - Use normal whitespace in editor pre tags. r=pbrosset
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 28 Apr 2015 16:15:00 -0400
changeset 273583 de4547be239c18eec6bb2488d0ab6be31ce59e7b
parent 273582 b4ad268f693877c4dc4d59f0b7ac4eff6ceaa079
child 273584 cc9ff30e82d6998e216d27fd66308017068aae6b
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs1046803
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1046803 - Use normal whitespace in editor pre tags. r=pbrosset
browser/devtools/markupview/markup-view.xhtml
browser/devtools/shared/inplace-editor.js
--- a/browser/devtools/markupview/markup-view.xhtml
+++ b/browser/devtools/markupview/markup-view.xhtml
@@ -80,17 +80,17 @@
      --><span save="${name}" class="attr-name theme-fg-color2"></span><!--
      -->=&quot;<!--
      --><span save="${val}" class="attr-value theme-fg-color6"></span><!--
      -->&quot;<!--
    --></span><!--
  --></span>
 
     <span id="template-text" save="${elt}" class="editor text">
-      <pre save="${value}" style="display:inline-block;" tabindex="0"></pre>
+      <pre save="${value}" style="display:inline-block; white-space: normal;" tabindex="0"></pre>
     </span>
 
     <span id="template-comment"
           save="${elt}"
           class="editor comment theme-comment"><!--
    --><span>&lt;!--</span><!--
    --><pre save="${value}" style="display:inline-block;" tabindex="0"></pre><!--
    --><span>--&gt;</span><!--
--- a/browser/devtools/shared/inplace-editor.js
+++ b/browser/devtools/shared/inplace-editor.js
@@ -242,16 +242,18 @@ function InplaceEditor(aOptions, aEvent)
     (e) => { e.stopPropagation(); }, false);
 
   this.validate = aOptions.validate;
 
   if (this.validate) {
     this.input.addEventListener("keyup", this._onKeyup, false);
   }
 
+  this._updateSize();
+
   if (aOptions.start) {
     aOptions.start(this, aEvent);
   }
 
   EventEmitter.decorate(this);
 }
 
 exports.InplaceEditor = InplaceEditor;
@@ -359,17 +361,16 @@ InplaceEditor.prototype = {
     // we get a chance to resize.  Yuck.
     let width = this._measurement.offsetWidth + 10;
 
     if (this.multiline) {
       // 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.
       width += 15;
-      this._measurement.textContent += "M";
       this.input.style.height = this._measurement.offsetHeight + "px";
     }
 
     this.input.style.width = width + "px";
   },
 
   /**
    * Get the width of a single character in the input to properly position the