WML support for local files is broken since content sniffing has been turned off for local files on Mac/CFNetwork. CFNetwork doesn't map the ".wml" file extension to the right WML MIME type. An Apple bug report has been opened to cover this issue. For the meanwhile, introduce a workaround to unbreak WML support on Mac.
Created attachment 30616 [details] Initial patch, working around the problem.
Created attachment 30617 [details] Updated patch Oops, uploaded the wrong patch, missing an include. Adding Brady as reviewer, as we discussed this in private before.
Created attachment 30618 [details] Updated patch v2 "StdLibExtras.h" -> <wtf/StdLibExtras.h> to preserve Qt build. It's also more correct this way. Sorry for the noise :-)
Can't we add the MIME type mapping somewhere in WebCore/WebKit instead of turning on sniffing for .wml fies?
(In reply to comment #4) > Can't we add the MIME type mapping somewhere in WebCore/WebKit instead of > turning on sniffing for .wml fies? Hm I'm unsure about that. Sounds fine in general. I'd love to hear Bradys opinion on that.
Comment on attachment 30618 [details] Updated patch v2 This is the wrong place for this workaround. The correct workaround would be to do extension-based MIME type mapping, not to turn on MIME type sniffing. This code needs to go in a place that's determining MIME types, not a place that's deciding whether to do content sniffing.
Eric and Darin are right - if we need to work around this, it needs to be based on extension -> MIME Type mapping. The one catch-all place to do this is in the didReceiveResponse method closest to the platform layer. We've done things like this recently in ResourceHandleMac.mm, I believe.
(In reply to comment #7) > Eric and Darin are right - if we need to work around this, it needs to be based > on extension -> MIME Type mapping. The one catch-all place to do this is in > the didReceiveResponse method closest to the platform layer. We've done things > like this recently in ResourceHandleMac.mm, I believe. Okay, I'm toying with this for some hours now until I found out didReceiveResponse is the "right spot" to do these hacks :-) But I still don't have any success. I added "[r _setMIMEType:@"text/vnd.wap.wml"];" as hack, just below the "m_handle->client()->didReceiveResponse(...)" call. That makes WebKit open the file and shows the file content, rendered as plain text. But I don't get any WML rendering. But I'm probably just on the wrong track, can you give me a hint? Thanks in advance, Niko
Created attachment 30803 [details] Updated patch v3 Found another workaround, that fixes the problem without enabling content sniffing. Hopefully it's fine this time.
Comment on attachment 30803 [details] Updated patch v3 Looks OK. r=me
Landed in r44294.