[webkit-dev] Mimetype for files loaded from disk?

Kevin Ollivier kevino at theolliviers.com
Mon Mar 17 10:53:51 PDT 2008


Hi Mike and all,

On Mar 16, 2008, at 10:26 PM, Mike Emmel wrote:

> In the curl backed some code uses file extensions to set the mime type
> for local files.
> I'm not sure css files are handled.

They aren't, neither for GTK or wx implementation. Adding it for the  
wx implementation did solve the problem, and is obviously a much  
better approach. Thanks! :-) I'll go ahead and add the CSS mime type  
to GTK's MIMETypeRegistry code as well. Whether or not it's bitten by  
this bug, I think it'd be good to add it.

I am still curious, however, if there is some difference in WebCore  
internally in terms of dealing with missing mimetype on Windows as  
opposed to Mac/Unix. If there is, and it is unintentional (e.g. it is  
intended only for Apple port on Win), it might be something that  
belongs at the WebKit level for each port. If it's intentional, I'm  
curious to know why we do things differently on Win.

Thanks,

Kevin

>
>
> On Sun, Mar 16, 2008 at 9:22 PM, Kevin Ollivier <kevino at theolliviers.com 
> > wrote:
>> Hi all,
>>
>> I've hit an issue with the wx port where HTML files that use @import
>> url("file.css") will not load when the HTML and CSS file are on disk
>> rather than loaded via the web. After tracking it down, I found  
>> that I
>> could resolve the issue by having CURL set the file type for
>> m_response to "application/x-unknown-content-type", which enables the
>> CachedCSSStyleSheet::canUseSheet test to pass, but I'm not sure this
>> is the right approach.
>>
>> Another wrinkle to this issue is that this problem doesn't appear on
>> the Windows wx port, only Linux/Mac. I'm fairly certain this
>> discrepancy is not due to wx code, and so I was wondering how other
>> ports (Apple's and otherwise) handle this issue. Is there some
>> alternative approach to setting the mimetype explicitly, or is there
>> some extension <-> mimetype mapping being used in some cases?
>>
>> Thanks,
>>
>> Kevin
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo/webkit-dev
>>



More information about the webkit-dev mailing list