WordPress.org

Ready to get started?Download WordPress

Forums

Toolbox
Bug: html5shiv is out of date (2 posts)

  1. Peter Wooster
    Member
    Posted 2 years ago #

    The version of html5shiv used in the toolbox theme is out of date and has a nasty bug that shows up in IE7. Paragraphs within blocks that have padding and background-color set do not display properly. The following code demonstrates the problem:

    <!DOCTYPE html>
    <html>
        <head>
    <script src="http://themes.svn.wordpress.org/toolbox/1.4/js/html5.js" type="text/javascript"></script>
    <style>
        section{
            padding:10px; background-color:yellow;
        }
    </style>
    </head>
    <body>
            <section>
    		<p>first line<br/>
                    second line</p>
            </section>
    </body>
    </html>

    The current version of html5shiv can downloaded from Remy Sharp or from

    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    and works properly.

    Please update the theme to fix this and the missing display:block issue.
    Thanks/peter

    http://wordpress.org/extend/plugins/toolbox/

    http://wordpress.org/extend/themes/toolbox/

  2. Bob Kerns
    Member
    Posted 1 year ago #

    Peter here seems to be including the code snippet above to indicate where to get the latest version of the HTML5 shim, and as such, it's almost correct. But as an example of how to actually include html5shim into your pages, it's a really bad idea, that has unfortunately propagated widely.

    That link is pulling it from a *source code repository*. This is a bad idea on so many levels I can't recount them all, but this site does a good job:

    http://zoompf.com/2012/05/html5shiv-and-serving-content-from-code-repositories

    But perhaps this will be enough to deter you: Loading it from there will make your page load *very slowly*. In fact, I first noticed it because a webcomic I follow was loading painfully slowly, waiting on this. The page uses WP; I'm still trying to figure out for the author where this link is coming from.

    The current html5shiv WP plugin looks like it does it almost right, by including the javascript code directly in the plugin. However, it could be improved by using minify to make the code smaller.

    But that's a minor point. I'm just posting this to help stop the further spread of this bad idea.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags