<s>
In	O
web	O
development	O
,	O
a	O
polyfill	B-Protocol
is	O
code	O
that	O
implements	O
a	O
feature	O
on	O
web	B-Application
browsers	I-Application
that	O
do	O
not	O
natively	O
support	O
the	O
feature	O
.	O
</s>
<s>
Most	O
often	O
,	O
it	O
refers	O
to	O
a	O
JavaScript	B-Language
library	B-Library
that	O
implements	O
an	O
HTML5	B-Application
or	O
CSS	B-Language
web	O
standard	O
,	O
either	O
an	O
established	O
standard	O
(	O
supported	O
by	O
some	O
browsers	B-Application
)	O
on	O
older	O
browsers	B-Application
,	O
or	O
a	O
proposed	O
standard	O
(	O
not	O
supported	O
by	O
any	O
browsers	B-Application
)	O
on	O
existing	O
browsers	B-Application
.	O
</s>
<s>
Formally	O
,	O
"	O
a	O
polyfill	B-Protocol
is	O
a	O
shim	B-General_Concept
for	O
a	O
browser	B-Application
API.	O
"	O
</s>
<s>
Polyfills	B-Protocol
allow	O
web	O
developers	O
to	O
use	O
an	O
API	B-Application
regardless	O
of	O
whether	O
or	O
not	O
it	O
is	O
supported	O
by	O
a	O
browser	B-Application
,	O
and	O
usually	O
with	O
minimal	O
overhead	O
.	O
</s>
<s>
Typically	O
they	O
first	O
check	O
if	O
a	O
browser	B-Application
supports	O
an	O
API	B-Application
,	O
and	O
use	O
it	O
if	O
available	O
,	O
otherwise	O
using	O
their	O
own	O
implementation	O
.	O
</s>
<s>
Polyfills	B-Protocol
themselves	O
use	O
other	O
,	O
more	O
supported	O
features	O
,	O
and	O
thus	O
different	O
polyfills	B-Protocol
may	O
be	O
needed	O
for	O
different	O
browsers	B-Application
.	O
</s>
<s>
The	O
term	O
is	O
also	O
used	O
as	O
a	O
verb	O
:	O
polyfilling	O
is	O
providing	O
a	O
polyfill	B-Protocol
for	O
a	O
feature	O
.	O
</s>
<s>
The	O
term	O
is	O
a	O
neologism	O
,	O
coined	O
by	O
Remy	O
Sharp	O
,	O
who	O
required	O
a	O
word	O
that	O
meant	O
"	O
replicate	O
an	O
API	B-Application
using	O
JavaScript	B-Language
(	O
or	O
Flash	O
or	O
whatever	O
)	O
if	O
the	O
browser	B-Application
does	O
n’t	O
have	O
it	O
natively	O
"	O
while	O
co-writing	O
the	O
book	O
Introducing	O
HTML5	B-Application
in	O
2009	O
.	O
</s>
<s>
Formally	O
,	O
"	O
a	O
shim	B-General_Concept
is	O
a	O
library	B-Library
that	O
brings	O
a	O
new	O
API	B-Application
to	O
an	O
older	O
environment	O
,	O
using	O
only	O
the	O
means	O
of	O
that	O
environment.	O
"	O
</s>
<s>
Polyfills	B-Protocol
exactly	O
fit	O
this	O
definition	O
;	O
the	O
term	O
shim	B-General_Concept
was	O
also	O
used	O
for	O
early	O
polyfills	B-Protocol
.	O
</s>
<s>
However	O
,	O
to	O
Sharp	O
shim	B-General_Concept
connoted	O
non-transparent	O
APIs	B-Application
and	O
workarounds	O
,	O
such	O
as	O
spacer	O
GIFs	O
for	O
layout	O
,	O
sometimes	O
known	O
as	O
shim.gif	O
,	O
and	O
similar	O
terms	O
such	O
as	O
progressive	O
enhancement	O
and	O
graceful	B-General_Concept
degradation	I-General_Concept
were	O
not	O
appropriate	O
,	O
so	O
he	O
invented	O
a	O
new	O
term	O
.	O
</s>
<s>
The	O
word	O
has	O
since	O
gained	O
popularity	O
,	O
particularly	O
due	O
to	O
its	O
use	O
by	O
Paul	O
Irish	O
and	O
in	O
Modernizr	B-Language
documentation	O
.	O
</s>
<s>
At	O
times	O
various	O
other	O
distinctions	O
are	O
drawn	O
between	O
shims	B-General_Concept
,	O
polyfills	B-Protocol
,	O
and	O
fallbacks	O
,	O
but	O
there	O
are	O
no	O
generally	O
accepted	O
distinctions	O
:	O
most	O
consider	O
polyfills	B-Protocol
a	O
form	O
of	O
shim	B-General_Concept
.	O
</s>
<s>
core-js	O
is	O
the	O
most	O
popular	O
and	O
powerful	O
JavaScript	B-Language
standard	B-Library
library	I-Library
polyfill	B-Protocol
.	O
</s>
<s>
Includes	O
polyfills	B-Protocol
for	O
ECMAScript	B-Language
up	O
to	O
the	O
latest	O
version	O
of	O
the	O
standard	O
:	O
promises	O
,	O
symbols	O
,	O
collections	O
,	O
iterators	O
,	O
typed	O
arrays	O
,	O
many	O
other	O
features	O
,	O
ECMAScript	B-Language
proposals	O
,	O
some	O
cross-platform	O
WHATWG	B-Language
/	O
W3C	O
features	O
and	O
proposals	O
like	O
URL	O
.	O
</s>
<s>
It	O
can	O
be	O
integrated	O
with	O
Babel	B-Language
,	O
which	O
allows	O
it	O
to	O
automatically	O
inject	O
required	O
core-js	O
modules	O
into	O
your	O
code	O
.	O
</s>
<s>
In	O
IE	O
versions	O
prior	O
to	O
9	O
,	O
unknown	O
HTML	O
elements	O
like	O
and	O
would	O
be	O
parsed	O
as	O
empty	O
elements	O
,	O
breaking	O
the	O
page	O
's	O
nesting	O
structure	O
and	O
making	O
those	O
elements	O
impossible	O
to	O
style	O
using	O
CSS	B-Language
.	O
</s>
<s>
One	O
of	O
the	O
most	O
widely	O
used	O
polyfills	B-Protocol
,	O
html5shiv	O
,	O
exploits	O
another	O
quirk	O
of	O
IE	O
to	O
work	O
around	O
this	O
bug	O
:	O
calling	O
document.createElement("tagname" )	O
for	O
each	O
of	O
the	O
new	O
HTML5	B-Application
elements	O
,	O
which	O
causes	O
IE	O
to	O
parse	O
them	O
correctly	O
.	O
</s>
<s>
It	O
also	O
includes	O
basic	O
default	O
styling	O
for	O
those	O
HTML5	B-Application
elements	O
.	O
</s>
<s>
Though	O
most	O
polyfills	B-Protocol
target	O
out-of-date	O
browsers	B-Application
,	O
some	O
exist	O
to	O
simply	O
push	O
modern	O
browsers	B-Application
forward	O
a	O
little	O
bit	O
more	O
.	O
</s>
<s>
Lea	O
Verou	O
's	O
-prefix-free	O
polyfill	B-Protocol
is	O
such	O
a	O
polyfill	B-Protocol
,	O
allowing	O
current	O
browsers	B-Application
to	O
recognise	O
the	O
unprefixed	O
versions	O
of	O
several	O
CSS3	O
properties	O
instead	O
of	O
requiring	O
the	O
developer	O
to	O
write	O
out	O
all	O
the	O
vendor	O
prefixes	O
.	O
</s>
<s>
It	O
reads	O
the	O
page	O
's	O
stylesheets	O
and	O
replaces	O
any	O
unprefixed	O
properties	O
with	O
their	O
prefixed	O
counterparts	O
recognised	O
by	O
the	O
current	O
browser	B-Application
.	O
</s>
<s>
Keith	O
Clark	O
's	O
Selectivizr	O
is	O
a	O
popular	O
polyfill	B-Protocol
that	O
makes	O
many	O
CSS3	O
selectors	O
work	O
in	O
IE	O
8	O
and	O
below	O
.	O
</s>
<s>
It	O
reads	O
the	O
page	O
's	O
stylesheets	O
looking	O
for	O
a	O
number	O
of	O
known	O
CSS3	O
selectors	O
,	O
then	O
uses	O
a	O
JavaScript	B-Language
selector	O
library	B-Library
to	O
query	O
the	O
document	O
for	O
elements	O
matching	O
those	O
selectors	O
,	O
applying	O
the	O
styles	O
directly	O
to	O
those	O
elements	O
.	O
</s>
<s>
It	O
supports	O
several	O
JavaScript	B-Language
selector	O
libraries	O
such	O
as	O
jQuery	B-Language
.	O
</s>
<s>
Flexie	O
can	O
still	O
be	O
used	O
along	O
with	O
the	O
old	O
syntax	O
,	O
but	O
the	O
developer	O
must	O
make	O
sure	O
they	O
include	O
the	O
new	O
syntax	O
for	O
future	O
browsers	B-Application
as	O
well	O
.	O
</s>
<s>
Its	O
rendering	O
is	O
mostly	O
indistinguishable	O
from	O
native	O
browser	B-Application
implementations	O
and	O
it	O
handles	O
dynamic	O
DOM	O
modification	O
well	O
.	O
</s>
<s>
Douglas	O
Crockford	O
originally	O
wrote	O
json2.js	O
as	O
an	O
API	B-Application
for	O
reading	O
and	O
writing	O
his	O
(	O
then	O
up-and-coming	O
)	O
JSON	B-General_Concept
data	O
format	O
.	O
</s>
<s>
It	O
became	O
so	O
widely	O
used	O
that	O
browser	B-Application
vendors	O
decided	O
to	O
implement	O
its	O
API	B-Application
natively	O
and	O
turn	O
it	O
into	O
a	O
de	O
facto	O
standard	O
;	O
Since	O
json2.js	O
now	O
implements	O
features	O
native	O
to	O
newer	O
browsers	B-Application
into	O
older	O
browsers	B-Application
,	O
it	O
has	O
become	O
a	O
polyfill	B-Protocol
instead	O
of	O
a	O
library	B-Library
.	O
</s>
<s>
ECMAScript	B-Language
5th	O
Edition	O
(	O
"	O
ES5	O
"	O
)	O
brings	O
some	O
useful	O
new	O
scripting	O
features	O
,	O
and	O
since	O
they	O
're	O
syntactically	O
compatible	O
with	O
older	O
JavaScript	B-Language
engines	O
they	O
can	O
mostly	O
be	O
polyfilled	O
by	O
patching	O
methods	O
onto	O
built-in	O
JS	O
objects	O
.	O
</s>
<s>
This	O
es5-shim	O
polyfill	B-Protocol
does	O
it	O
in	O
two	O
parts	O
:	O
es5-shim.js	O
contains	O
those	O
methods	O
that	O
can	O
be	O
fully	O
polyfilled	O
,	O
and	O
es5-sham.js	O
contains	O
partial	O
implementations	O
of	O
the	O
other	O
methods	O
which	O
rely	O
too	O
much	O
on	O
the	O
underlying	O
engine	O
to	O
work	O
accurately	O
.	O
</s>
<s>
FlashCanvas	O
is	O
an	O
implementation	O
of	O
the	O
HTML5	B-Application
Canvas	O
API	B-Application
using	O
an	O
Adobe	B-Operating_System
Flash	I-Operating_System
plug-in	O
.	O
</s>
<s>
A	O
rare	O
commercial	O
polyfill	B-Protocol
,	O
it	O
comes	O
in	O
a	O
paid	O
version	O
,	O
as	O
well	O
as	O
a	O
free	O
version	O
,	O
which	O
lacks	O
a	O
few	O
advanced	O
features	O
like	O
shadows	O
.	O
</s>
<s>
John	O
Dyer	O
's	O
MediaElement.js	O
polyfills	B-Protocol
support	O
for	O
<video> and <audio>	O
elements	O
,	O
including	O
the	O
HTML5	B-Application
MediaElement	O
API	B-Application
,	O
in	O
older	O
browsers	B-Application
using	O
Flash	O
or	O
Silverlight	O
plug-ins	O
.	O
</s>
<s>
It	O
also	O
provides	O
an	O
optional	O
media	O
player	O
UI	O
for	O
those	O
elements	O
,	O
which	O
is	O
consistent	O
across	O
all	O
browsers	B-Application
.	O
</s>
<s>
Alexander	O
Farkas	O
's	O
Webshims	O
Lib	O
aggregates	O
many	O
other	O
polyfills	B-Protocol
together	O
into	O
a	O
single	O
package	O
and	O
conditionally	O
loads	O
only	O
those	O
needed	O
by	O
the	O
visiting	O
browser	B-Application
.	O
</s>
<s>
Hyphenopoly.js	O
enables	O
automatic	O
hyphenation	O
if	O
it	O
is	O
not	O
already	O
supported	O
by	O
the	O
browser	B-Application
for	O
the	O
respective	O
document	O
language	O
.	O
</s>
