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

Added <template> + default CSS #95

Closed brianblakely closed 11 years ago

jonathantneal commented 11 years ago

Hi Brian. Would you kill the newline at the end of the file and squash it, then make the appropriate changes to html5shiv-printshiv.js as well?

If not, I can. I'd prefer to have everything in this merge.

jonathantneal commented 11 years ago

Thanks, I think you're making the changes as we speak. Is it just me, a caching issue, or are you seeing "0 changed files with 0 additions and 0 deletions" too?

brianblakely commented 11 years ago

printshiv impending

brianblakely commented 11 years ago

I am also seeing it

jonathantneal commented 11 years ago

I only see the newline remaining, which is good enough for me. Merge!

tchalvak commented 11 years ago

For clarity, since I wasn't even aware that there -was- a template element, though I don't know that Editor's draft applies as there actually being a template element at the moment. Anyway: https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#template-element Essentially, a dummy element for containing html-for-later-inclusion, an alternative to using a hidden div for the same purpose.

brianblakely commented 11 years ago

@tchalvak Already hit Chrome Beta, and here is a polyfill for the current spec (using minimal shim): http://jsfiddle.net/brianblakely/h3EmY/

ffuubarbuzz commented 11 years ago

In the latest version I can see this pull request in sources, but not in minified js, https://github.com/aFarkas/html5shiv/blob/master/dist/html5shiv.js

ffuubarbuzz commented 11 years ago

And one more thing: assuming that html5shiv polyfills HTML5 tempate element, consider change snippet

<!--[if lt IE 9]>

to include IE10 too, which does not support HTML5 template element.

WanderingZombie commented 11 years ago

http://msdn.microsoft.com/en-us/library/ie/hh801214(v=vs.85).aspx

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers. This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.

brianblakely commented 11 years ago

In addition to Zombie's note, IE9 and above do not require The HTML5 Shiv at all. The HTML5 Shiv does not polyfill an element's special functionality, but simply makes it styleable in IE8 and below.

ffuubarbuzz commented 11 years ago

HTML5 Shiv makes template elements usable in IE8- (as documentFragment for cloning purposes). When you include HTML5 Shiv with conditional comment for IE8-, you can use template elements in IE8-, but not in IE9, 10. Correct me if I'm wrong, but there isn't much sense in styling template tags, cause it's used only for cloning. It feels strange, that you should include template polyfill for IE9, 10 when you already has HTML5 Shiv included, which enables template in EI8-.

brianblakely commented 11 years ago

Template does have an essential default style, which is display: none.

The Shiv uses document fragments as a part of its core mechanism, but that is not related to template's API. The "content" property for template elements will still be undefined in browsers that do not support them (unless you use something like the polyfill in my fiddle, posted earlier in this thread).

ffuubarbuzz commented 11 years ago

I've got it, I was totally wrong. Sorry for all that noise. But the question about latest minified js is still actual.