Created
September 11, 2013 19:48
-
-
Save sorvell/6528827 to your computer and use it in GitHub Desktop.
ShadowDOM Polyfill distribution failure
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> | |
<head> | |
<script src="../../../polymer/polymer.js"></script> | |
</head> | |
<body> | |
<x-host> | |
<x-inner-host></x-inner-host> | |
</x-host> | |
<script> | |
function makeSR(selector, html) { | |
var node = document.querySelector(selector); | |
if (node) { | |
node.createShadowRoot().innerHTML = html; | |
} | |
} | |
makeSR('x-inner-host', '<div>inner-host shadowRoot</div>'); | |
// note: this must be created last and the content must have whitespace | |
// after it. | |
makeSR('x-host', '<div>host shadowRoot</div><content></content> '); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment