blob: 7016a8ef3d1a50f73b29bc9d6bbc24a2d69393ec (
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
|
<!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>
</body>
</html>
|