Content deleted Content added
Anton.bersh (talk | contribs) →Definition: remove link to deleted article |
explanation of term "shiv" no longer occurs several paragraphs before the first usage of the word. |
||
Line 8:
==Definition==
The term is a [[neologism]], coined by Remy Sharp, who required a word that meant "replicate an API using JavaScript (or Flash or whatever) if the browser doesn’t have it natively" while co-writing the book ''Introducing HTML5'' in 2009.<ref name="introducing276">{{cite book |title=Introducing HTML5 |author1=Bruce Lawson |author2=Remy Sharp |section=Introducing Polyfills |pages=[https://books.google.com/books?id=a8HQCk4pbQkC&pg=PA276 276–277]}}</ref><ref name="sharp2010">{{cite web |last=Sharp |first=Remy |title=What is a polyfill? |url=http://remysharp.com/2010/10/08/what-is-a-polyfill/ |access-date=13 January 2012}}</ref> Formally, "a shim is a [[Library (computing)|library]] that brings a new API to an older environment, using only the means of that environment.",<ref name="speakingjs"/> and polyfills exactly fit this definition; the term ''shim'' was also used for early polyfills.<ref>{{cite web |quote=This piece of information makes building an HTML5 compatibility shim for IE7 far easier than had previously been assumed.|title=Mistakes, Sadness, Regret |url=http://ln.hixie.ch/?start=1201080691&count=1 |author-link=Ian Hickson |author=Ian Hickson |date=2008-01-23}}</ref>
The distinction that Sharp makes is:<ref name="introducing276"/>
Line 21:
=== HTML5 Shiv ===
In IE versions prior to 9, unknown HTML elements like {{tag|section|o}} and {{tag|nav|o}} would be parsed as empty elements, breaking the page's nesting structure and making those elements impossible to style using [[CSS]]. One of the most widely used polyfills, html5shiv{{efn|The use of the term ''shiv'' here is a pun or mistake on ''shim.''<ref name="introducing276"/>}}, exploits another quirk of IE to work around this bug: calling <code>document.createElement("tagname")</code> for each of the new HTML5 elements, which causes IE to parse them correctly. It also includes basic default styling for those HTML5 elements.
=== -prefix-free ===
|