html5shiv icon indicating copy to clipboard operation
html5shiv copied to clipboard

Consider an IE8+ version of HTML5Shiv

Open jonathantneal opened this issue 13 years ago • 5 comments
trafficstars

There could be lots of optimisations done for an IE8+ version.

In a world where IE6 and IE7 step aside, IE8 would then offer new approaches to the same HTML5 incompatibilities. One approach would be to drop the list of sectioning elements in lieu of a defineProperty listener, hijacking the innerHTML setter, and shivving support for new elements responsively.

http://www.jonathantneal.com/blog/a-close-shiv/

jonathantneal avatar Jun 20 '12 18:06 jonathantneal

I think it's worth exploring.

also it's be "IE8" instead of "IE8+" right?

paulirish avatar Jun 20 '12 19:06 paulirish

True that. IE8.

(Unless there's something IE9 isn't telling us, or the unlikely event that more polyfilling and style shimmings make their way in.)

jonathantneal avatar Jun 20 '12 19:06 jonathantneal

I also thought about using defineProperty to fix IE8. From my point of view this approach is soooo much cleaner and looks extremly promissing.

I have just added a first draft in the defineProperty branch. What we need is a really good cloneNode patch, new unit tests, perf (and size) optimizations and documentation.

Some important points:

  1. Do not redeclare body.innerHTML. This totally destroys the robustness of this approach (and this is the main advantage over our duckpunch). If someone wants to add html5shiv at the bottom of a document or load it async, she/he can write those lines her/his own (But we should make clear that his can harm other scripts and is really bad for performance).
  2. This script should never mix IE6/7 solutions with IE8 solutions. The defineProperty approach is so much better and different, that we can not guarantee similiar behavior. (Therefore this scripts also adds a false positive for supportsUnknownElements in 6/7.
  3. Before moving on with this branch, I would like to finalize/release the current version 3.6 in the main branch. It's marked as RC and is fully unit tested. After releasing it, I want to start on the documentation. So please review :-).

aFarkas avatar Jun 24 '12 14:06 aFarkas

Hey guys, pinging this conversation again. What would you think about a rewrite for v4? Here are three suggestions.

  1. More fun. Shiv the prototype & defineProperty way.
  2. More clear. The v3 IE6+ version becomes the branch, like normalize.css did it.
  3. Less legal. Switch to MIT or Public Domain license.

jonathantneal avatar Jan 24 '14 05:01 jonathantneal

In short: YES!!! With 2. I would wait a little bit.

aFarkas avatar Jan 24 '14 09:01 aFarkas