Bug 256649 - Stop treating text/xsl as an XML MIME type
Summary: Stop treating text/xsl as an XML MIME type
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anne van Kesteren
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-11 08:42 PDT by Anne van Kesteren
Modified: 2023-05-28 09:10 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2023-05-11 08:42:31 PDT
As the MIME Sniffing Standard requires and other browser behave.
Comment 1 Radar WebKit Bug Importer 2023-05-11 09:07:52 PDT
<rdar://problem/109211253>
Comment 2 Anne van Kesteren 2023-05-11 09:09:06 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13760
Comment 3 Anne van Kesteren 2023-05-27 06:30:09 PDT
We have these relevant files in LayoutTests:

fast/xsl/xslt-enc-cyr.xml
fast/xsl/xslt-enc.xml
fast/xsl/xslt-enc16.xml
fast/xsl/xslt-enc16to16.xml
fast/xsl/xslt-entity-enc.xml
fast/xsl/xslt-text.html

The expectation is that the XSLT is decoded using UTF-8.

Per https://github.com/WebKit/WebKit/commit/7c5509f22cb96221a2a556cedb3f8d0ef9abc7cf#diff-64e5dc08b95e4ca6ad90d8b8791caffbcb760805f0c8f4c4bd83cda39537ead9 it appears that's a function of the MIME type in WebKit. Whether that's correct is not entirely clear to me. Might also just be that the XSLT "loader" ought to enforce that.

However, I don't plan to investigate this further for now.
Comment 4 Chris Dumez 2023-05-27 09:07:30 PDT
Dupe to https://bugs.webkit.org/show_bug.cgi?id=257360 ?
Comment 5 Anne van Kesteren 2023-05-27 22:58:04 PDT
I think there's still a potential issue due to TextResourceDecoder.cpp now including a text/xsl check. At least I'm pretty sure this doesn't match how Gecko handles loading XSLT.
Comment 6 Chris Dumez 2023-05-28 09:10:44 PDT
(In reply to Anne van Kesteren from comment #5)
> I think there's still a potential issue due to TextResourceDecoder.cpp now
> including a text/xsl check. At least I'm pretty sure this doesn't match how
> Gecko handles loading XSLT.

I see. I had to add this check to keep the tests under fast/xsl passing.