Created
January 9, 2012 05:05
-
-
Save kits/1581223 to your computer and use it in GitHub Desktop.
HTML5 Shiv HTC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<public:attach event="oncontentready" onevent="" /> | |
<script type="text/javascript"> | |
var doc = element.document; | |
var win = doc.parentWindow; | |
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed | |
// Uncompressed source: https://github.com/aFarkas/html5shiv | |
(function(a,b){var c=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveChildren&&e.shivDocument(b.document),b},a.createDocumentFragment=function(){return e.shivDocument(g())});if(!d&&h){var j=f("div");j.innerHTML=["x<style>","article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}","audio{display:none}","canvas,video{display:inline-block;*display:inline;*zoom:1}","[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}","mark{background:#FF0;color:#000}","</style>"].join(""),h.insertBefore(j.lastChild,h.firstChild)}return a}};e.shivDocument(b),a.html5=e})(win,doc) | |
// HTML5 Shiv end. | |
element.innerHTML += ''; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="./ie.css"> | |
<style> | |
body { | |
margin:0; | |
padding:0; | |
font-family:'Arial', sans-serif; | |
} | |
header, nav, article, | |
section, aside, footer { | |
margin:10px; | |
border:solid 10px; | |
} | |
header { border-color:#fcc; } | |
nav { border-color:#cfc; } | |
article { border-color:#ccf; } | |
section { border-color:#ff9; } | |
aside { border-color:#f9f; } | |
footer { border-color:#9ff; } | |
</style> | |
<title>HTML5 Shiv HTC test</title> | |
</head> | |
<body> | |
<header> | |
<h1>header</h1> | |
</header> | |
<nav> | |
<h1>navigation</h1> | |
</nav> | |
<article> | |
<h1>article</h1> | |
<p>Link element:</p> | |
<pre><code><link rel="stylesheet" href="./<a href="ie.css">ie.css</a>"></code></pre> | |
<p>ie.css:</p> | |
<pre><code>body { behavior:url(./<a href="html5.htc">html5.htc</a>); }</code></pre> | |
<section> | |
<h1>section</h1> | |
<p>Style element:</p> | |
<pre><code><style> | |
body { | |
margin:0; | |
padding:0; | |
font-family:'Arial', sans-serif; | |
} | |
header, nav, article, | |
section, aside, footer { | |
margin:10px; | |
border:solid 10px; | |
} | |
header { border-color:#fcc; } | |
nav { border-color:#cfc; } | |
article { border-color:#ccf; } | |
section { border-color:#ff9; } | |
aside { border-color:#f9f; } | |
footer { border-color:#9ff; } | |
<style></code></pre> | |
</section> | |
</article> | |
<aside> | |
<h1>aside</h1> | |
</aside> | |
<footer> | |
<h1>footer</h1> | |
</footer> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { behavior:url(./html5.htc); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment