aFarkas / html5shiv

This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.
http://paulirish.com/2011/the-history-of-the-html5-shiv/
9.89k stars 2.56k forks source link

Updated Type check for shived innerHTML #102

Open Nevraeka opened 11 years ago

Nevraeka commented 11 years ago

The "content" parameter for "innerHTML" was not coerced to a string in the event it is a "Number" type. IE8 internal handles this for standard elements.

aFarkas commented 11 years ago

Thanks. I just looked into it and I think the following line change would be shorter and more performant:

if (!elem.canHaveChildren || elem.document == ownerDocument || !html5.shivMethods || typeof content != 'string') {
    return innerDesc.set.apply(elem, arguments);
}

Note, I have only added the typeof content check.

Nevraeka commented 11 years ago

Cool. Sorry for the delay in checking this. Thanks