summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/nodeset-duplicates.html
blob: cb99c8c46ccc9a236b846b5986a071b706bc61dc (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
27
28
29
30
31
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <body>
    <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12359">bug 12359</a>:
    XPathEvaluator may return some nodes more than once in a result set.</p>

    <div>
      <div>
        <div></div>
      </div>
    </div>

    <script type="text/javascript">
      if (window.layoutTestController)
        layoutTestController.dumpAsText();

      try {
        var result = document.evaluate("//div//div | //div/div", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

        if (result.snapshotLength == 2)
          document.write("SUCCESS");
        else
          document.write(result.snapshotLength + " matches (should be 2)");

      } catch (ex) {
        document.write("Exception: " + ex);
      }
    </script>
  </body>
</html>