Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <script> |
michael@0 | 5 | function tweak() { |
michael@0 | 6 | var olderShadow = document.getElementById('outer').createShadowRoot(); |
michael@0 | 7 | olderShadow.innerHTML = '<content></content><span>World</span>'; |
michael@0 | 8 | |
michael@0 | 9 | var youngerShadow = document.getElementById('outer').createShadowRoot(); |
michael@0 | 10 | youngerShadow.innerHTML = '<div id="shadowparent"><shadow id="youngshadow"><span>Hello</span></shadow></div>'; |
michael@0 | 11 | |
michael@0 | 12 | var shadowParent = youngerShadow.getElementById("shadowparent"); |
michael@0 | 13 | var nestedShadow = shadowParent.createShadowRoot(); |
michael@0 | 14 | nestedShadow.innerHTML = '<div style="background-color: green"><content></content></div>'; |
michael@0 | 15 | |
michael@0 | 16 | // Dynamically append a span to the shadow element in the younger ShadowRoot to make sure |
michael@0 | 17 | // it is projected into the nested shadow. |
michael@0 | 18 | var appendedSpan = document.createElement("span"); |
michael@0 | 19 | appendedSpan.textContent = ' '; |
michael@0 | 20 | youngerShadow.getElementById("youngshadow").appendChild(appendedSpan); |
michael@0 | 21 | } |
michael@0 | 22 | </script> |
michael@0 | 23 | </head> |
michael@0 | 24 | <body onload="tweak()"> |
michael@0 | 25 | <div id="outer"> |
michael@0 | 26 | <div style="width:300px; height:100px; background-color:red;"></div> |
michael@0 | 27 | </div> |
michael@0 | 28 | </body> |
michael@0 | 29 | </html> |