HTML5shim: how do <video> and <audio> render in legacy browsers?

196 Views Asked by At

how exactly do and tags render in IE 9 and below after using the HTML5shim?

I know the shim fixes semantic styling tags. But does it enable elements to function? If not, does the browser render anything in its place? or simply treat it like it does not exist?

1

There are 1 best solutions below

2
On

What the shim does is create an environment where HTML5 tags are accepted and can (somewhat) support CSS styling.

When an old browser encounters an unknown tag, it will still put it into the DOM, but simply ignore it (well some extremely ancient or exotic ones will throw an error, but at least IE8- won't).

More precisely, it will consider the tag as a blank/transparent container and still process what's inside. That's why IE8- can display "your browser is trash, dude" or launch a flash object to play a vid from within a video tag.

What the shim does is clone some of these unknown tags (the so-called semantic tags, (a glorified name for google bots honeypots, if you ask me) : header, footer, etc) into regular spans or divs (it does that just after the document was loaded) so that old browsers can now see good ole vintage tags and style them.

In case of video/audio tags, HTML5shim will make absolutely no difference.

Your video tag will be indeed recognized by IE8- as an unknown tag, and you will get the usual "sorry dude, your browser is junk" display, provided the page creator was kind enough to provide one.