summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/ancestor-axis.html
blob: cb75273feb906e75f2f2fa79d0c7b8ef35789dbc (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
<html>
<body>
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12619">bug 12619</a>:
Non-abbreviated XPaths don't work.</p>

  <div id="a"></div>

<script>
  if (window.layoutTestController)
    layoutTestController.dumpAsText();

  try {
    result = document.evaluate("//div/ancestor::*", document.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

    if (2 == result.snapshotLength)
      document.write("SUCCESS");
    else
      document.write("FAILURE: " + result.snapshotLength + " result nodes (should be 2)");
  } catch (ex) {
    document.write("FAILURE: " + ex);
  }
</script>
</body>
</html>