Home | History | Annotate | Download | only in xpath
      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
      2          "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
      3 <html xmlns="http://www.w3.org/1999/xhtml">
      4   <head>
      5     <title/>
      6   </head>
      7   <body>
      8     <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12581">bug 12581</a>:
      9     XPath //title shouldn't match &lt;title> in XHTML.</p>
     10     <div id="result">FAILURE: script did't run</div>
     11     <script>
     12         if (window.layoutTestController)
     13             layoutTestController.dumpAsText();
     14 
     15         var result = document.evaluate("//title", document.documentElement, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
     16         if (result.snapshotLength == 0)
     17             document.getElementById("result").firstChild.nodeValue = "SUCCESS";
     18         else
     19             document.getElementById("result").firstChild.nodeValue = "FAILURE: " + result.snapshotLength + " node(s) matched - should be 0";
     20     </script>
     21   </body>
     22 </html>
     23