[webkit-help] Windows - loadHTMLString() not loading/using stylesheet from html page

Alexander Shulgin alexander.shulgin at yessoftware.com
Thu Feb 24 08:04:13 PST 2011


On 24.02.2011 18:01, Lakshmi P Shanmugam wrote:
> Hello all,
>
> I'm using the Windows WebKit APIs.
> I'm trying to display html content which uses an external css file as
> stylesheet. I'm using IWebFrame.loadHTMLString(string, baseURL) with
> baseURL=0.
> The content is displayed but the style from the css is not applied on
> the content. The same html content is displayed correctly with the style
> if I save the html content in a file and load the URL.
> I'm not sure why this is happening.

You are violating the security constraints.  Basically, only HTML 
content loaded through file:// URL is allowed to access other file:// 
resources.

You may embed the css using the <stylesheet type="text/css"> tag in the 
<head> section of your HTML.

--
Alex


More information about the webkit-help mailing list