Bug 706886 - Line-through disappears after editing overridden rule in style inspector; f=rcampbell; r=joewalker
authorDave Camp <dcamp@mozilla.com>
Fri, 13 Jan 2012 13:05:49 -0500
changeset 85775 b8281fe1b926a7089efa196522257e6bd82e578c
parent 85774 fb9e08e7281525f5574bcbf7e4258ffedbb33a16
child 85776 f7c8c8ee3fad1d0812b05857db00cf22632ff685
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoewalker
bugs706886
milestone12.0a1
Bug 706886 - Line-through disappears after editing overridden rule in style inspector; f=rcampbell; r=joewalker
browser/devtools/styleinspector/CssRuleView.jsm
--- a/browser/devtools/styleinspector/CssRuleView.jsm
+++ b/browser/devtools/styleinspector/CssRuleView.jsm
@@ -1137,17 +1137,18 @@ TextPropertyEditor.prototype = {
  *    {function} start:
  *       Will be called when the inplace editor is initialized.
  *    {function} change:
  *       Will be called when the text input changes.  Will be called
  *       with the current value of the text input.
  *    {function} done:
  *       Called when input is committed or blurred.  Called with
  *       current value and a boolean telling the caller whether to
- *       commit the change.
+ *       commit the change.  This function is called after the editor
+ *       has been torn down.
  *    {string} advanceChars:
  *       If any characters in advanceChars are typed, focus will advance
  *       to the next element.
  */
 function editableField(aOptions)
 {
   aOptions.element.addEventListener("focus", function() {
     new InplaceEditor(aOptions);
@@ -1281,21 +1282,21 @@ InplaceEditor.prototype = {
   },
 
   /**
    * Handle loss of focus by calling the client's done handler and
    * clearing out.
    */
   _onBlur: function InplaceEditor_onBlur(aEvent)
   {
+    let val = this.input.value.trim();
+    this._clear();
     if (this.done) {
-      this.done(this.cancelled ? this.initial : this.input.value.trim(),
-                !this.cancelled);
+      this.done(this.cancelled ? this.initial : val, !this.cancelled);
     }
-    this._clear();
   },
 
   _onKeyPress: function InplaceEditor_onKeyPress(aEvent)
   {
     let prevent = false;
     if (aEvent.charCode in this._advanceCharCodes
        || aEvent.keyCode === Ci.nsIDOMKeyEvent.DOM_VK_RETURN) {
       // Focus the next element, triggering a blur which