haikuwebkit/LayoutTests/inspector/dom/template-content.html

34 lines
1.1 KiB
HTML

<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test() {
WI.domManager.requestDocument(function(documentNode) {
documentNode.querySelector("#div", function(nodeId) {
var domNode = WI.domManager.nodeForId(nodeId);
InspectorTest.expectThat(domNode, "Got DOMNode for div element");
InspectorTest.expectThat(!domNode.templateContent(), "DOMNode does not have template content");
});
documentNode.querySelector("#template", function(nodeId) {
var domNode = WI.domManager.nodeForId(nodeId);
InspectorTest.log("");
InspectorTest.expectThat(domNode, "Got DOMNode for template element");
InspectorTest.expectThat(domNode.templateContent(), "DOMNode has template content");
InspectorTest.completeTest();
});
});
}
</script>
</head>
<body onload="runTest()">
<p>Test that we include template content in DOM Nodes for &lt;template&gt; elements.</p>
<div id="div"></div>
<template id="template">
<h1>Header</h1>
<p>Paragraph</p>
</template>
</body>
</html>