Title: [214487] trunk/Source/WebInspectorUI
Revision
214487
Author
commit-qu...@webkit.org
Date
2017-03-28 12:21:00 -0700 (Tue, 28 Mar 2017)

Log Message

Web Inspector: Unable to Format JSON Request Data
https://bugs.webkit.org/show_bug.cgi?id=170189

Patch by Joseph Pecoraro <pecor...@apple.com> on 2017-03-28
Reviewed by Matt Baker.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
When we are viewing request data we are looking at a TextResourceContentView
which has a TextEditor without a delegate. In these cases we can just assume
a _javascript_ Program. In the majority of cases this will typically be JSON
data, and either Program or Module will highlight and format as expected.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (214486 => 214487)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-03-28 19:05:42 UTC (rev 214486)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-03-28 19:21:00 UTC (rev 214487)
@@ -1,3 +1,17 @@
+2017-03-28  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Unable to Format JSON Request Data
+        https://bugs.webkit.org/show_bug.cgi?id=170189
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/TextEditor.js:
+        (WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
+        When we are viewing request data we are looking at a TextResourceContentView
+        which has a TextEditor without a delegate. In these cases we can just assume
+        a _javascript_ Program. In the majority of cases this will typically be JSON
+        data, and either Program or Module will highlight and format as expected.
+
 2017-03-27  Devin Rousso  <web...@devinrousso.com>
 
         Web Inspector: Option-clicking the close tab button should close all other tabs

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js (214486 => 214487)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2017-03-28 19:05:42 UTC (rev 214486)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2017-03-28 19:21:00 UTC (rev 214487)
@@ -839,7 +839,7 @@
         let indentString = WebInspector.indentString();
         const includeSourceMapData = true;
 
-        let sourceType = this._delegate.textEditorScriptSourceType(this);
+        let sourceType = this._delegate ? this._delegate.textEditorScriptSourceType(this) : WebInspector.Script.SourceType.Program;
         const isModule = sourceType === WebInspector.Script.SourceType.Module;
 
         let workerProxy = WebInspector.FormatterWorkerProxy.singleton();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to