Changeset 247533 in webkit


Ignore:
Timestamp:
Jul 17, 2019 1:39:29 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: application/xml content not shown
https://bugs.webkit.org/show_bug.cgi?id=199861

Patch by Olivier Blin <Olivier Blin> on 2019-07-17
Reviewed by Devin Rousso.

Source/WebInspectorUI:

application/xml content from XHR requests was not shown in the
inspector, an error message was displayed instead.

application/xml content should be treated as text, since
application/xml is the standard mimetype for XML content.
Apache serves XML content with the application/xml mimetype by
default.

  • UserInterface/Base/MIMETypeUtilities.js:

(WI.fileExtensionForMIMEType):
Report "xml" extension for "application/xml" mimetype.
(WI.shouldTreatMIMETypeAsText):
Treat XML files as text.

LayoutTests:

  • inspector/unit-tests/mimetype-utilities-expected.txt:
  • inspector/unit-tests/mimetype-utilities.html:

Test for shouldTreatMIMETypeAsText.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247530 r247533  
     12019-07-17  Olivier Blin  <olivier.blin@softathome.com>
     2
     3        Web Inspector: application/xml content not shown
     4        https://bugs.webkit.org/show_bug.cgi?id=199861
     5
     6        Reviewed by Devin Rousso.
     7
     8        * inspector/unit-tests/mimetype-utilities-expected.txt:
     9        * inspector/unit-tests/mimetype-utilities.html:
     10        Test for shouldTreatMIMETypeAsText.
     11
    1122019-07-17  Daniel Bates  <dabates@apple.com>
    213
  • trunk/LayoutTests/inspector/unit-tests/mimetype-utilities-expected.txt

    r239343 r247533  
    3939PASS: "image/svg+xml" should be treated as text.
    4040PASS: "text/x-coffeescript" should be treated as text.
     41PASS: "application/xml" should be treated as text.
    4142PASS: "image/jpeg" should not be treated as text.
    4243PASS: "image/png" should not be treated as text.
  • trunk/LayoutTests/inspector/unit-tests/mimetype-utilities.html

    r239343 r247533  
    7272            expectText("image/svg+xml");
    7373            expectText("text/x-coffeescript");
     74            expectText("application/xml");
    7475
    7576            expectNotText("image/jpeg");
  • trunk/Source/WebInspectorUI/ChangeLog

    r247492 r247533  
     12019-07-17  Olivier Blin  <olivier.blin@softathome.com>
     2
     3        Web Inspector: application/xml content not shown
     4        https://bugs.webkit.org/show_bug.cgi?id=199861
     5
     6        Reviewed by Devin Rousso.
     7
     8        application/xml content from XHR requests was not shown in the
     9        inspector, an error message was displayed instead.
     10
     11        application/xml content should be treated as text, since
     12        application/xml is the standard mimetype for XML content.
     13        Apache serves XML content with the application/xml mimetype by
     14        default.
     15
     16        * UserInterface/Base/MIMETypeUtilities.js:
     17        (WI.fileExtensionForMIMEType):
     18        Report "xml" extension for "application/xml" mimetype.
     19        (WI.shouldTreatMIMETypeAsText):
     20        Treat XML files as text.
     21
    1222019-07-16  Nikita Vasilyev  <nvasilyev@apple.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js

    r239343 r247533  
    171171        "text/html": "html",
    172172        "application/xhtml+xml": "xhtml",
     173        "application/xml": "xml",
    173174        "text/xml": "xml",
    174175
     
    316317        return true;
    317318
    318     // Various media text mime types.
    319319    let extension = WI.fileExtensionForMIMEType(mimeType);
    320     if (extension === "m3u8" || extension === "m3u")
     320    if (extension === "xml")
    321321        return true;
    322322
     
    324324    if (extension === "js" || extension === "json")
    325325        return true;
     326
     327    // Various media text mime types.
     328    if (extension === "m3u8" || extension === "m3u")
     329        return true;
     330
    326331    if (mimeType.startsWith("application/"))
    327         return mimeType.endsWith("script") || mimeType.endsWith("json");
     332        return mimeType.endsWith("script") || mimeType.endsWith("json") || mimeType.endsWith("xml");
    328333
    329334    return false;
Note: See TracChangeset for help on using the changeset viewer.