Web Inspector: m3u8 content not shown, it should be text
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 19:18:44 +0000 (19:18 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 19:18:44 +0000 (19:18 +0000)
commit1d70eada3b08a604e458a2c38030ffb8af557ad3
tree5992667219e5ee7f90392f3809a6590a77a0cfd6
parentc65e67bf55426aba4c39fcb896a4d57fa186db39
Web Inspector: m3u8 content not shown, it should be text
https://bugs.webkit.org/show_bug.cgi?id=192731
<rdar://problem/46747728>

Reviewed by Devin Rousso.

Source/WebCore:

* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::setResourceContent):
Don't clobber data if setting empty content on a resource that has content.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldTreatAsText):
Additional non-"text/" mime types that can be treated as text.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
* platform/MIMETypeRegistry.h:
Detect media playlist mime types that are text (m3u8/m3u).

Source/WebInspectorUI:

* UserInterface/Base/MIMETypeUtilities.js:
(WI.shouldTreatMIMETypeAsText):
Support m3u8/m3u files as text.

LayoutTests:

* inspector/unit-tests/mimetype-utilities-expected.txt:
* inspector/unit-tests/mimetype-utilities.html:
Tests for shouldTreatMIMETypeAsText.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/unit-tests/mimetype-utilities-expected.txt
LayoutTests/inspector/unit-tests/mimetype-utilities.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/NetworkResourcesData.cpp
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/MIMETypeRegistry.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js
Source/WebInspectorUI/UserInterface/Test/TestHarness.js