views:

210

answers:

2

I'm using the WebBrowser control in a C# application to render an XML document (initially loaded from a file, but then modified programmatically) styled with CSS. I've upgraded to IE8 and confirmed that the WebBrowser control is using IE8, but my user:before and user:after rules with content are not having any effect. The plain user rule with color and display: block work fine, so the stylesheet is being used.

Perhaps this has something to do with "standards mode"? Is there a way to put IE8 into standards mode when the document is XML from a file?

+1  A: 

This might provide some insight:

How to programmatically turn off quirks mode in IE8 WebBrowser control

Robert Harvey
Thanks for the reply. I've set the appropriate key under FEATURE_BROWSER_EMULATION to 8000, but I'm still not able to get CSS generated content to work. I've tried 8888 and 8 too. This is using a recent IE8 (downloaded yesterday).
Dan Ellis
A: 

Here is some info on registry settings specifically for the web browser control. Note that they specifically render content in the web browser control in IE7 mode by default, to avoid breaking existing pages.

WebBrowser Control Rendering Modes in IE8
http://blogs.msdn.com/ie/archive/2008/03/18/webbrowser-control-rendering-modes-in-ie8.aspx

Robert Harvey
I believe that's an old registry setting that relates to the beta version of IE8, not the RTM.
Dan Ellis