[ 
https://issues.apache.org/jira/browse/WICKET-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050288#comment-13050288
 ] 

Martin Grigorov commented on WICKET-3801:
-----------------------------------------

Wicket can generate a proper <html class="anything here"> just by using 
WebClientInfo. No need of Modernizr.
Construct the class attribute value with 
getSession().getClientInfo().getClientProperties().isBrowserXyz(). From 
ClientProperties you can also extract whether JS is enabled and the major/minor 
version of the browser. Then set the class with AttributeModifier and voila.

You can use TransparentWebMarkupContainer for the <html> tag if you want to 
avoid the additional add().

The bug in the parser should be fixed but even then I'd prefer the programmatic 
way instead of using IE conditional comments.

> Wicket fails parsing conditional comments surrounding the <html> tag
> --------------------------------------------------------------------
>
>                 Key: WICKET-3801
>                 URL: https://issues.apache.org/jira/browse/WICKET-3801
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC4
>         Environment: Win32, JDK 1.6.0_24
>            Reporter: Christian Lerch
>            Assignee: Juergen Donnerstag
>
> When you use conditional comments on the <html> tag, like:
> <!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
> <!--[if IE 7 ]>    <html class="no-js ie7" lang="en"> <![endif]-->
> <!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
> <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> 
> <!--<![endif]-->
> which is valid (x)html code, you'll get: 
> Unexpected RuntimeException
> Last cause: Tag does not have a close tag

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to