“第一类型”不是作为内容选择值工作吗?

时间:2014-08-09 10:25:06

标签: html5 css-selectors web-component shadow-dom

为什么“footer text1”不在下面的代码中显示?
我的浏览器是Chrome 36.0.1985.125

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <div id="example">
        <h2>Eric</h2>
        <h2>Bidelman</h2>
        <div>Digital Jedi</div>
        <h4>footer text1</h4>
        <h4>footer text2</h4>
    </div>

    <template id="sdom">
        <header>
            <content select="h2"></content>
        </header>
        <section>
            <content select="div"></content>
        </section>
        <footer>
            <content select="h4:first-of-type"></content>
        </footer>
    </template>

    <script type="text/javascript">
        var container = document.querySelector('#example');
        var root = container.createShadowRoot();
        var t = document.querySelector('#sdom');
        var clone = document.importNode(t.content, true);
        root.appendChild(clone);
    </script>
</body>
</html>