summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/xpath/xpath-template-element.html
blob: c3c9ff5a20e9ecb9edb7e29846a440e7625384e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<p>This tests that XPath expressions do not consider (traverse into) template content</p>

<div id=test>
    <span>A</span>
    <span>B</span>
    <template>
        <span>C</span>
        <span>D</span>
    </template>
</div>

<div id="console"></div>
<script>
var test = document.getElementById('test');
var result = document.evaluate('count(//span)', test, null, XPathResult.NUMBER_TYPE, null);
shouldBe("document.evaluate('count(//span)', test, null, XPathResult.NUMBER_TYPE, null).numberValue", "2");
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>