Title: [158795] branches/safari-537.73-branch/Source/WebInspectorUI
Revision
158795
Author
[email protected]
Date
2013-11-06 14:40:42 -0800 (Wed, 06 Nov 2013)

Log Message

Merged rr157966.  <rdar://problem/15406689>

Modified Paths


Diff

Modified: branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog (158794 => 158795)


--- branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog	2013-11-06 22:37:56 UTC (rev 158794)
+++ branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog	2013-11-06 22:40:42 UTC (rev 158795)
@@ -1,5 +1,25 @@
 2013-11-06  Lucas Forschler  <[email protected]>
 
+        Merge rr157966
+
+    2013-10-24  Timothy Hatcher  <[email protected]>
+
+            Allow editing CSS resources after they have been pretty printed.
+
+            https://bugs.webkit.org/show_bug.cgi?id=123297
+
+            Reviewed by Joseph Pecoraro.
+
+            * UserInterface/TextEditor.js:
+            (WebInspector.TextEditor): Remove the need for _readOnly.
+            (WebInspector.TextEditor.prototype.set readOnly): Set CodeMirror readOnly directly.
+            (WebInspector.TextEditor.prototype.set formatted): Don't call _updateCodeMirrorReadOnly.
+            (WebInspector.TextEditor.prototype._updateCodeMirrorReadOnly): Removed.
+            (WebInspector.TextEditor.prototype._contentChanged): Clear _formatted and _formatterSourceMap
+            on edit and notify the delegate and fire the FormattingDidChange event.
+
+2013-11-06  Lucas Forschler  <[email protected]>
+
         Merge r156675
 
     2013-09-30  Antoine Quint  <[email protected]>

Modified: branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/TextEditor.js (158794 => 158795)


--- branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/TextEditor.js	2013-11-06 22:37:56 UTC (rev 158794)
+++ branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/TextEditor.js	2013-11-06 22:40:42 UTC (rev 158795)
@@ -32,10 +32,8 @@
     this._element.classList.add(WebInspector.TextEditor.StyleClassName);
     this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
 
-    this._readOnly = true;
-
     this._codeMirror = CodeMirror(this.element, {
-        readOnly: this._readOnly,
+        readOnly: true,
         indentWithTabs: true,
         indentUnit: 4,
         lineNumbers: true,
@@ -150,8 +148,7 @@
 
     set readOnly(readOnly)
     {
-        this._readOnly = readOnly;
-        this._updateCodeMirrorReadOnly();
+        this._codeMirror.setOption("readOnly", readOnly);
     },
 
     get formatted()
@@ -174,7 +171,6 @@
         console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
 
         this._formatted = formatted;
-        this._updateCodeMirrorReadOnly();
 
         this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
     },
@@ -582,15 +578,21 @@
 
     // Private
 
-    _updateCodeMirrorReadOnly: function()
-    {
-        this._codeMirror.setOption("readOnly", this._readOnly || this._formatted);
-    },
-
     _contentChanged: function(codeMirror, change)
     {
         if (this._ignoreCodeMirrorContentDidChangeEvent > 0)
             return;
+
+        if (this._formatted) {
+            this._formatterSourceMap = null;
+            this._formatted = false;
+
+            if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function")
+                this._delegate.textEditorUpdatedFormatting(this);
+
+            this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
+        }
+
         this.dispatchEventToListeners(WebInspector.TextEditor.Event.ContentDidChange);
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to