Title: [214492] trunk
Revision
214492
Author
[email protected]
Date
2017-03-28 13:57:11 -0700 (Tue, 28 Mar 2017)

Log Message

Web Inspector: Inspecting a Main Resource that is JS/JSON does not format / syntax highlight it properly
https://bugs.webkit.org/show_bug.cgi?id=166862
<rdar://problem/29835977>

Patch by Joseph Pecoraro <[email protected]> on 2017-03-28
Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.get syntheticMIMEType):
Don't override the mime type for Document resources. They should always
have a mime type and we should use whatever it is.

LayoutTests:

* http/tests/inspector/network/resource-mime-type-expected.txt: Added.
* http/tests/inspector/network/resource-mime-type.html: Added.
Test resource mime types for different resources.

* http/tests/inspector/network/resources/json.php: Added.
* http/tests/inspector/network/resources/script.js: Added.
* http/tests/inspector/network/resources/script.txt: Added.
* http/tests/inspector/network/resources/stylesheet.css: Added.
* http/tests/inspector/network/resources/stylesheet.txt: Added.
* http/tests/resources/square20.jpg: Added.
Resources for various requests and different mime types.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214491 => 214492)


--- trunk/LayoutTests/ChangeLog	2017-03-28 20:50:36 UTC (rev 214491)
+++ trunk/LayoutTests/ChangeLog	2017-03-28 20:57:11 UTC (rev 214492)
@@ -1,3 +1,23 @@
+2017-03-28  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Inspecting a Main Resource that is JS/JSON does not format / syntax highlight it properly
+        https://bugs.webkit.org/show_bug.cgi?id=166862
+        <rdar://problem/29835977>
+
+        Reviewed by Brian Burg.
+
+        * http/tests/inspector/network/resource-mime-type-expected.txt: Added.
+        * http/tests/inspector/network/resource-mime-type.html: Added.
+        Test resource mime types for different resources.
+
+        * http/tests/inspector/network/resources/json.php: Added.
+        * http/tests/inspector/network/resources/script.js: Added.
+        * http/tests/inspector/network/resources/script.txt: Added.
+        * http/tests/inspector/network/resources/stylesheet.css: Added.
+        * http/tests/inspector/network/resources/stylesheet.txt: Added.
+        * http/tests/resources/square20.jpg: Added.
+        Resources for various requests and different mime types.
+
 2017-03-28  Ryan Haddad  <[email protected]>
 
         Mark http/tests/xmlhttprequest/simple-cross-origin-progress-events.html as flaky.

Added: trunk/LayoutTests/http/tests/inspector/network/resource-mime-type-expected.txt (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resource-mime-type-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resource-mime-type-expected.txt	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1,148 @@
+Tests for the `mimeType` and `syntheticMIMEType` properties of different Resource Types.
+
+
+== Running test suite: Resource.MIMEType
+-- Running test case: Resource.MIMEType.Script.js
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-script'.
+PASS: Resource mimeType should be 'application/x-_javascript_'.
+PASS: Resource syntheticMIMEType should be 'application/x-_javascript_'.
+
+-- Running test case: Resource.MIMEType.Script.txt
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-script'.
+PASS: Resource mimeType should be 'text/plain'.
+PASS: Resource syntheticMIMEType should be 'text/_javascript_'.
+
+-- Running test case: Resource.MIMEType.Stylesheet.css
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-stylesheet'.
+PASS: Resource mimeType should be 'text/css'.
+PASS: Resource syntheticMIMEType should be 'text/css'.
+
+-- Running test case: Resource.MIMEType.Stylesheet.txt
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-stylesheet'.
+PASS: Resource mimeType should be 'text/plain'.
+PASS: Resource syntheticMIMEType should be 'text/css'.
+
+-- Running test case: Resource.MIMEType.Image.png
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-image'.
+PASS: Resource mimeType should be 'image/png'.
+PASS: Resource syntheticMIMEType should be 'image/png'.
+
+-- Running test case: Resource.MIMEType.Image.jpg
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-image'.
+PASS: Resource mimeType should be 'image/jpeg'.
+PASS: Resource syntheticMIMEType should be 'image/jpeg'.
+
+-- Running test case: Resource.MIMEType.XHR.js
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'application/x-_javascript_'.
+PASS: Resource syntheticMIMEType should be 'application/x-_javascript_'.
+
+-- Running test case: Resource.MIMEType.XHR.css
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'text/css'.
+PASS: Resource syntheticMIMEType should be 'text/css'.
+
+-- Running test case: Resource.MIMEType.XHR.png
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'image/png'.
+PASS: Resource syntheticMIMEType should be 'image/png'.
+
+-- Running test case: Resource.MIMEType.XHR.txt
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'image/jpeg'.
+PASS: Resource syntheticMIMEType should be 'image/jpeg'.
+
+-- Running test case: Resource.MIMEType.XHR.json
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'application/json'.
+PASS: Resource syntheticMIMEType should be 'application/json'.
+
+-- Running test case: Resource.MIMEType.XHR.html
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-xhr'.
+PASS: Resource mimeType should be 'text/html'.
+PASS: Resource syntheticMIMEType should be 'text/html'.
+
+-- Running test case: Resource.MIMEType.Fetch.js
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'application/x-_javascript_'.
+PASS: Resource syntheticMIMEType should be 'application/x-_javascript_'.
+
+-- Running test case: Resource.MIMEType.Fetch.css
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'text/css'.
+PASS: Resource syntheticMIMEType should be 'text/css'.
+
+-- Running test case: Resource.MIMEType.Fetch.png
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'image/png'.
+PASS: Resource syntheticMIMEType should be 'image/png'.
+
+-- Running test case: Resource.MIMEType.Fetch.txt
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'image/jpeg'.
+PASS: Resource syntheticMIMEType should be 'image/jpeg'.
+
+-- Running test case: Resource.MIMEType.Fetch.json
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'application/json'.
+PASS: Resource syntheticMIMEType should be 'application/json'.
+
+-- Running test case: Resource.MIMEType.Fetch.html
+PASS: Resource should be created.
+PASS: Resource Type should be 'resource-type-fetch'.
+PASS: Resource mimeType should be 'text/html'.
+PASS: Resource syntheticMIMEType should be 'text/html'.
+
+-- Running test case: Resource.MIMEType.Document.js
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'application/x-_javascript_'.
+PASS: Resource syntheticMIMEType should be 'application/x-_javascript_'.
+
+-- Running test case: Resource.MIMEType.Document.css
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'text/css'.
+PASS: Resource syntheticMIMEType should be 'text/css'.
+
+-- Running test case: Resource.MIMEType.Document.png
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'image/png'.
+PASS: Resource syntheticMIMEType should be 'image/png'.
+
+-- Running test case: Resource.MIMEType.Document.txt
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'image/jpeg'.
+PASS: Resource syntheticMIMEType should be 'image/jpeg'.
+
+-- Running test case: Resource.MIMEType.Document.json
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'application/json'.
+PASS: Resource syntheticMIMEType should be 'application/json'.
+
+-- Running test case: Resource.MIMEType.Document.html
+PASS: Frame MainResource should be created.
+PASS: Resource Type should be 'resource-type-document'.
+PASS: Resource mimeType should be 'text/html'.
+PASS: Resource syntheticMIMEType should be 'text/html'.
+

Added: trunk/LayoutTests/http/tests/inspector/network/resource-mime-type.html (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resource-mime-type.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resource-mime-type.html	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1,304 @@
+<!-- No DOCTYPE to avoid Flakey Strict Mode Console Warning -->
+<html>
+<head>
+<script src=""
+<script>
+function loadDocumentWithURL(url) {
+    let iframe = document.createElement("iframe");
+    iframe.src = ""
+    document.body.appendChild(iframe);
+}
+
+function loadScriptWithURL(url) {
+    let script = document.createElement("script");
+    script.src = ""
+    document.body.appendChild(script);
+}
+
+function loadStyleSheetWithURL(url) {
+    let link = document.createElement("link");
+    link.rel = "stylesheet";
+    link.href = ""
+    document.head.appendChild(link);
+}
+
+function loadImageWithURL(url) {
+    let img = document.createElement("img");
+    img.src = ""
+    document.body.appendChild(img);
+}
+
+function loadXHRWithURL(url) {
+    let xhr = new XMLHttpRequest;
+    xhr.open("GET", url, true);
+    xhr.send();
+}
+
+function loadFetchWithURL(url) {
+    fetch(url);
+}
+
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite("Resource.MIMEType");
+
+    function addTestCase({name, description, _expression_, type, mimeType, synthetic}) {
+        suite.addTestCase({
+            name, description,
+            test(resolve, reject) {
+                InspectorTest.evaluateInPage(_expression_);
+                WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
+                    let resource = event.data.resource;
+                    InspectorTest.expectThat(resource instanceof WebInspector.Resource, "Resource should be created.");
+                    resource.singleFireEventListener(WebInspector.Resource.Event.ResponseReceived, (event) => {
+                        InspectorTest.expectEqual(resource.type, type, `Resource Type should be '${type}'.`);
+                        InspectorTest.expectEqual(resource.mimeType, mimeType, `Resource mimeType should be '${mimeType}'.`);
+                        InspectorTest.expectEqual(resource.syntheticMIMEType, synthetic, `Resource syntheticMIMEType should be '${synthetic}'.`);
+                        resolve();
+                    });
+                });
+            }
+        });
+    }
+
+    function addDocumentResourceTestCase({name, description, _expression_, type, mimeType, synthetic}) {
+        suite.addTestCase({
+            name, description,
+            test(resolve, reject) {
+                InspectorTest.evaluateInPage(_expression_);
+                WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ChildFrameWasAdded, (event) => {
+                    // At this point the frame's resource has loaded.
+                    let resource = event.data.childFrame.mainResource;
+                    InspectorTest.expectThat(resource instanceof WebInspector.Resource, "Frame MainResource should be created.");
+                    InspectorTest.expectEqual(resource.type, type, `Resource Type should be '${type}'.`);
+                    InspectorTest.expectEqual(resource.mimeType, mimeType, `Resource mimeType should be '${mimeType}'.`);
+                    InspectorTest.expectEqual(resource.syntheticMIMEType, synthetic, `Resource syntheticMIMEType should be '${synthetic}'.`);
+                    resolve();
+                });
+            }
+        });
+    }
+
+    // These are the Apache MIME types returned for file extensions.
+    let mimeTypeForExtension = {
+        js: "application/x-_javascript_",
+        json: "application/json",
+        css: "text/css",
+        txt: "text/plain",
+        html: "text/html",
+        png: "image/png",
+        jpg: "image/jpeg",
+    };
+
+    // Scripts.
+
+    addTestCase({
+        name: "Resource.MIMEType.Script.js",
+        _expression_: `loadScriptWithURL("resources/script.js")`,
+        type: WebInspector.Resource.Type.Script,
+        mimeType: mimeTypeForExtension.js,
+        synthetic: mimeTypeForExtension.js,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Script.txt",
+        _expression_: `loadScriptWithURL("resources/script.txt")`,
+        type: WebInspector.Resource.Type.Script,
+        mimeType: mimeTypeForExtension.txt,
+        synthetic: "text/_javascript_",
+    });
+
+    // Stylesheets.
+
+    addTestCase({
+        name: "Resource.MIMEType.Stylesheet.css",
+        _expression_: `loadStyleSheetWithURL("resources/stylesheet.css")`,
+        type: WebInspector.Resource.Type.Stylesheet,
+        mimeType: mimeTypeForExtension.css,
+        synthetic: mimeTypeForExtension.css,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Stylesheet.txt",
+        _expression_: `loadStyleSheetWithURL("resources/stylesheet.txt")`,
+        type: WebInspector.Resource.Type.Stylesheet,
+        mimeType: mimeTypeForExtension.txt,
+        synthetic: "text/css",
+    });
+
+    // Images.
+
+    addTestCase({
+        name: "Resource.MIMEType.Image.png",
+        _expression_: `loadImageWithURL("/resources/square100.png")`,
+        type: WebInspector.Resource.Type.Image,
+        mimeType: mimeTypeForExtension.png,
+        synthetic: mimeTypeForExtension.png,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Image.jpg",
+        _expression_: `loadImageWithURL("/resources/square20.jpg")`,
+        type: WebInspector.Resource.Type.Image,
+        mimeType: mimeTypeForExtension.jpg,
+        synthetic: mimeTypeForExtension.jpg,
+    });
+
+    // XHRs.
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.js",
+        _expression_: `loadXHRWithURL("resources/script.js")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.js,
+        synthetic: mimeTypeForExtension.js,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.css",
+        _expression_: `loadXHRWithURL("resources/stylesheet.css")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.css,
+        synthetic: mimeTypeForExtension.css,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.png",
+        _expression_: `loadXHRWithURL("/resources/square100.png")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.png,
+        synthetic: mimeTypeForExtension.png,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.txt",
+        _expression_: `loadXHRWithURL("/resources/square20.jpg")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.jpg,
+        synthetic: mimeTypeForExtension.jpg,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.json",
+        _expression_: `loadXHRWithURL("resources/json.php")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.json,
+        synthetic: mimeTypeForExtension.json,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.XHR.html",
+        _expression_: `loadXHRWithURL("resources/data.html")`,
+        type: WebInspector.Resource.Type.XHR,
+        mimeType: mimeTypeForExtension.html,
+        synthetic: mimeTypeForExtension.html,
+    });
+
+    // Fetch.
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.js",
+        _expression_: `loadFetchWithURL("resources/script.js")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.js,
+        synthetic: mimeTypeForExtension.js,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.css",
+        _expression_: `loadFetchWithURL("resources/stylesheet.css")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.css,
+        synthetic: mimeTypeForExtension.css,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.png",
+        _expression_: `loadFetchWithURL("/resources/square100.png")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.png,
+        synthetic: mimeTypeForExtension.png,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.txt",
+        _expression_: `loadFetchWithURL("/resources/square20.jpg")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.jpg,
+        synthetic: mimeTypeForExtension.jpg,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.json",
+        _expression_: `loadFetchWithURL("resources/json.php")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.json,
+        synthetic: mimeTypeForExtension.json,
+    });
+
+    addTestCase({
+        name: "Resource.MIMEType.Fetch.html",
+        _expression_: `loadFetchWithURL("resources/data.html")`,
+        type: WebInspector.Resource.Type.Fetch,
+        mimeType: mimeTypeForExtension.html,
+        synthetic: mimeTypeForExtension.html,
+    });
+
+    // Documents.
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.js",
+        _expression_: `loadDocumentWithURL("resources/script.js")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.js,
+        synthetic: mimeTypeForExtension.js,
+    });
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.css",
+        _expression_: `loadDocumentWithURL("resources/stylesheet.css")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.css,
+        synthetic: mimeTypeForExtension.css,
+    });
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.png",
+        _expression_: `loadDocumentWithURL("/resources/square100.png")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.png,
+        synthetic: mimeTypeForExtension.png,
+    });
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.txt",
+        _expression_: `loadDocumentWithURL("/resources/square20.jpg")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.jpg,
+        synthetic: mimeTypeForExtension.jpg,
+    });
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.json",
+        _expression_: `loadDocumentWithURL("resources/json.php")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.json,
+        synthetic: mimeTypeForExtension.json,
+    });
+
+    addDocumentResourceTestCase({
+        name: "Resource.MIMEType.Document.html",
+        _expression_: `loadDocumentWithURL("resources/data.html")`,
+        type: WebInspector.Resource.Type.Document,
+        mimeType: mimeTypeForExtension.html,
+        synthetic: mimeTypeForExtension.html,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests for the `mimeType` and `syntheticMIMEType` properties of different Resource Types.</p>
+</body>
+</html>

Added: trunk/LayoutTests/http/tests/inspector/network/resources/json.php (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resources/json.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/json.php	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1,4 @@
+<?php
+header("Content-Type: application/json");
+echo '{"version": 1}';
+?>

Added: trunk/LayoutTests/http/tests/inspector/network/resources/script.js (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resources/script.js	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/script.js	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1 @@
+function myScriptJS() {}

Added: trunk/LayoutTests/http/tests/inspector/network/resources/script.txt (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resources/script.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/script.txt	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1 @@
+function myScriptTXT() {}

Added: trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.css (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.css	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.css	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1 @@
+#stylesheet-css { color: blue; }

Added: trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.txt (0 => 214492)


--- trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/stylesheet.txt	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1 @@
+#stylesheet-txt { color: orange; }

Added: trunk/LayoutTests/http/tests/resources/square20.jpg (0 => 214492)


--- trunk/LayoutTests/http/tests/resources/square20.jpg	                        (rev 0)
+++ trunk/LayoutTests/http/tests/resources/square20.jpg	2017-03-28 20:57:11 UTC (rev 214492)
@@ -0,0 +1 @@
+\xFF\xD8\xFF\xE0JFIFHH\xFF\xDBC\xFF\xDBC\xFF\xC2\xFF\xC4	\xFF\xC4	\xFF\xDA\x8E{\xF9+\xFF\xC40\xFF\xDA\xFF\xC40\xFF\xDA?\xFF\xC40\xFF\xDA?\xFF\xC40\xFF\xDA?\xFF\xC40\xFF\xDA?!\xFF\xDA\xFF\xC40\xFF\xDA?\xFF\xC40\xFF\xDA?\xFF\xC40\xFF\xDA?\xFF\xD9
\ No newline at end of file

Modified: trunk/Source/WebInspectorUI/ChangeLog (214491 => 214492)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-03-28 20:50:36 UTC (rev 214491)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-03-28 20:57:11 UTC (rev 214492)
@@ -1,5 +1,18 @@
 2017-03-28  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Inspecting a Main Resource that is JS/JSON does not format / syntax highlight it properly
+        https://bugs.webkit.org/show_bug.cgi?id=166862
+        <rdar://problem/29835977>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Models/Resource.js:
+        (WebInspector.Resource.prototype.get syntheticMIMEType):
+        Don't override the mime type for Document resources. They should always
+        have a mime type and we should use whatever it is.
+
+2017-03-28  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Unable to Format JSON Request Data
         https://bugs.webkit.org/show_bug.cgi?id=170189
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js (214491 => 214492)


--- trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js	2017-03-28 20:50:36 UTC (rev 214491)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js	2017-03-28 20:57:11 UTC (rev 214492)
@@ -270,8 +270,6 @@
         // Return the default MIME-types for the Resource.Type, since the current MIME-type
         // does not match what is expected for the Resource.Type.
         switch (this._type) {
-        case WebInspector.Resource.Type.Document:
-            return "text/html";
         case WebInspector.Resource.Type.Stylesheet:
             return "text/css";
         case WebInspector.Resource.Type.Script:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to