summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/ensure-null-namespace.xhtml
blob: c0cd4ff1030c99c3c3df1f4c673f8f1046cc398d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
         "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title/>
  </head>
  <body>
    <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12581">bug 12581</a>:
    XPath //title shouldn't match &lt;title> in XHTML.</p>
    <div id="result">FAILURE: script did't run</div>
    <script>
        if (window.layoutTestController)
            layoutTestController.dumpAsText();

        var result = document.evaluate("//title", document.documentElement, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
        if (result.snapshotLength == 0)
            document.getElementById("result").firstChild.nodeValue = "SUCCESS";
        else
            document.getElementById("result").firstChild.nodeValue = "FAILURE: " + result.snapshotLength + " node(s) matched - should be 0";
    </script>
  </body>
</html>