Title: [236892] trunk/Source/WebInspectorUI
Revision
236892
Author
[email protected]
Date
2018-10-05 18:06:20 -0700 (Fri, 05 Oct 2018)

Log Message

Web Inspector: add WebVTT MIME/file type mappings to the frontend
https://bugs.webkit.org/show_bug.cgi?id=190288

Reviewed by Brian Burg.

* UserInterface/Base/MIMETypeUtilities.js:
(WI.mimeTypeForFileExtension):
(WI.fileExtensionForMIMEType):

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.displayNameForResource):
Also attempt to use the mime-type-to-extension when the `WI.Resource` is of type `Other`.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (236891 => 236892)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-10-06 00:20:54 UTC (rev 236891)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-10-06 01:06:20 UTC (rev 236892)
@@ -1,5 +1,20 @@
 2018-10-05  Devin Rousso  <[email protected]>
 
+        Web Inspector: add WebVTT MIME/file type mappings to the frontend
+        https://bugs.webkit.org/show_bug.cgi?id=190288
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/MIMETypeUtilities.js:
+        (WI.mimeTypeForFileExtension):
+        (WI.fileExtensionForMIMEType):
+
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView.displayNameForResource):
+        Also attempt to use the mime-type-to-extension when the `WI.Resource` is of type `Other`.
+
+2018-10-05  Devin Rousso  <[email protected]>
+
         Web Inspector: refactor constructor of WI.Resource
         https://bugs.webkit.org/show_bug.cgi?id=190318
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js (236891 => 236892)


--- trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js	2018-10-06 00:20:54 UTC (rev 236891)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js	2018-10-06 01:06:20 UTC (rev 236892)
@@ -48,12 +48,13 @@
         "xml": "text/xml",
 
         // Script types.
-        "js": "text/_javascript_",
+        "js": "application/_javascript_",
         "json": "application/json",
         "clj": "text/x-clojure",
         "coffee": "text/x-coffeescript",
         "ls": "text/x-livescript",
         "ts": "text/typescript",
+        "ps": "application/postscript",
         "jsx": "text/jsx",
 
         // Stylesheet types.
@@ -71,9 +72,85 @@
         "png": "image/png",
         "tif": "image/tiff",
         "tiff": "image/tiff",
+        "xbm": "image/x-xbitmap",
+        "webp": "image/webp",
+        "ico": "image/x-icon",
 
-        // Font types and Media types are ignored for now.
+        "ogx": "application/ogg",
+        "ogg": "audio/ogg",
+        "oga": "audio/ogg",
+        "ogv": "video/ogg",
 
+        // Annodex
+        "anx": "application/annodex",
+        "axa": "audio/annodex",
+        "axv": "video/annodex",
+        "spx": "audio/speex",
+
+        // WebM
+        "webm": "video/webm",
+
+        // MPEG
+        "m1a": "audio/mpeg",
+        "m2a": "audio/mpeg",
+        "mpg": "video/mpeg",
+        "m15": "video/mpeg",
+        "m1s": "video/mpeg",
+        "m1v": "video/mpeg",
+        "m75": "video/mpeg",
+        "mpa": "video/mpeg",
+        "mpeg": "video/mpeg",
+        "mpm": "video/mpeg",
+        "mpv": "video/mpeg",
+
+        // MPEG playlist
+        "m3u8": "application/x-mpegurl",
+        "m3url": "audio/x-mpegurl",
+        "m3u": "audio/x-mpegurl",
+
+        // MPEG-4
+        "m4v": "video/x-m4v",
+        "m4a": "audio/x-m4a",
+        "m4b": "audio/x-m4b",
+        "m4p": "audio/x-m4p",
+
+        // MP3
+        "mp3": "audio/mp3",
+
+        // MPEG-2
+        "mp2": "video/x-mpeg2",
+        "vob": "video/mpeg2",
+        "mod": "video/mpeg2",
+        "m2ts": "video/m2ts",
+        "m2t": "video/x-m2ts",
+
+        // 3GP/3GP2
+        "3gpp": "audio/3gpp",
+        "3g2": "audio/3gpp2",
+        "amc": "application/x-mpeg",
+
+        // AAC
+        "aac": "audio/aac",
+        "adts": "audio/aac",
+        "m4r": "audio/x-aac",
+
+        // CoreAudio File
+        "caf": "audio/x-caf",
+        "gsm": "audio/x-gsm",
+
+        // ADPCM
+        "wav": "audio/x-wav",
+
+        // Text Track
+        "vtt": "text/vtt",
+
+        // Font
+        "woff": "font/woff",
+        "woff2": "font/woff2",
+        "otf": "font/otf",
+        "ttf": "font/ttf",
+        "sfnt": "font/sfnt",
+
         // Miscellaneous types.
         "svg": "image/svg+xml",
         "txt": "text/plain",
@@ -95,12 +172,28 @@
         "text/xml": "xml",
 
         // Script types.
+        "application/ecmascript": "js",
+        "application/_javascript_": "js",
+        "application/x-ecmascript": "js",
+        "application/x-_javascript_": "js",
+        "text/ecmascript": "js",
         "text/_javascript_": "js",
+        "text/_javascript_1.0": "js",
+        "text/_javascript_1.1": "js",
+        "text/_javascript_1.2": "js",
+        "text/_javascript_1.3": "js",
+        "text/_javascript_1.4": "js",
+        "text/_javascript_1.5": "js",
+        "text/jscript": "js",
+        "text/x-ecmascript": "js",
+        "text/x-_javascript_": "js",
         "application/json": "json",
         "text/x-clojure": "clj",
         "text/x-coffeescript": "coffee",
+        "text/livescript": "ls",
         "text/x-livescript": "ls",
         "text/typescript": "ts",
+        "application/postscript": "ps",
         "text/jsx": "jsx",
 
         // Stylesheet types.
@@ -112,13 +205,86 @@
         // Image types.
         "image/bmp": "bmp",
         "image/gif": "gif",
+        "image/jp2": "jp2",
         "image/jpeg": "jpg",
         "application/pdf": "pdf",
+        "text/pdf": "pdf",
         "image/png": "png",
         "image/tiff": "tiff",
+        "image/x-xbitmap": "xbm",
+        "image/webp": "webp",
+        "image/vnd.microsoft.icon": "ico",
+        "image/x-icon": "ico",
 
-        // Font types and Media types are ignored for now.
+        // Ogg
+        "application/ogg": "ogx",
+        "audio/ogg": "ogg",
 
+        // Annodex
+        "application/annodex": "anx",
+        "audio/annodex": "axa",
+        "video/annodex": "axv",
+        "audio/speex": "spx",
+
+        // WebM
+        "video/webm": "webm",
+        "audio/webm": "webm",
+
+        // MPEG
+        "video/mpeg": "mpeg",
+
+        // MPEG playlist
+        "application/vnd.apple.mpegurl": "m3u8",
+        "application/mpegurl": "m3u8",
+        "application/x-mpegurl": "m3u8",
+        "audio/mpegurl": "m3u",
+        "audio/x-mpegurl": "m3u",
+
+        // MPEG-4
+        "video/x-m4v": "m4v",
+        "audio/x-m4a": "m4a",
+        "audio/x-m4b": "m4b",
+        "audio/x-m4p": "m4p",
+        "audio/mp4": "m4a",
+
+        // MP3
+        "audio/mp3": "mp3",
+        "audio/x-mp3": "mp3",
+        "audio/x-mpeg": "mp3",
+
+        // MPEG-2
+        "video/x-mpeg2": "mp2",
+        "video/mpeg2": "vob",
+        "video/m2ts": "m2ts",
+        "video/x-m2ts": "m2t",
+
+        // 3GP/3GP2
+        "audio/3gpp": "3gpp",
+        "audio/3gpp2": "3g2",
+        "application/x-mpeg": "amc",
+
+        // AAC
+        "audio/aac": "aac",
+        "audio/x-aac": "m4r",
+
+        // CoreAudio File
+        "audio/x-caf": "caf",
+        "audio/x-gsm": "gsm",
+
+        // ADPCM
+        "audio/x-wav": "wav",
+        "audio/vnd.wave": "wav",
+
+        // Text Track
+        "text/vtt": "vtt",
+
+        // Font
+        "font/woff": "woff",
+        "font/woff2": "woff2",
+        "font/otf": "otf",
+        "font/ttf": "ttf",
+        "font/sfnt": "sfnt",
+
         // Miscellaneous types.
         "image/svg+xml": "svg",
         "text/plain": "txt",

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (236891 => 236892)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2018-10-06 00:20:54 UTC (rev 236891)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2018-10-06 01:06:20 UTC (rev 236892)
@@ -140,7 +140,7 @@
 
     static displayNameForResource(resource)
     {
-        if (resource.type === WI.Resource.Type.Image || resource.type === WI.Resource.Type.Font) {
+        if (resource.type === WI.Resource.Type.Image || resource.type === WI.Resource.Type.Font || resource.type === WI.Resource.Type.Other) {
             let fileExtension;
             if (resource.mimeType)
                 fileExtension = WI.fileExtensionForMIMEType(resource.mimeType);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to