Home | History | Annotate | Download | only in xpath
      1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
      2 <html>
      3 <head>
      4 <link rel="stylesheet" href="../js/resources/js-test-style.css">
      5 <script src="../js/resources/js-test-pre.js"></script>
      6 </head>
      7 <body>
      8 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41913">bug 41913</a>:
      9 XPath substring function does not correctly handle non-positive values for the position argument</p>
     10 <div id="console"></div>
     11 
     12 <script>
     13     shouldBe("document.evaluate(\"substring('abcde', 0)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcde'");
     14     shouldBe("document.evaluate(\"substring('abcde', -2)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcde'");
     15     shouldBe("document.evaluate(\"substring('abcde', 0, 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcd'");
     16     shouldBe("document.evaluate(\"substring('abcde', -2, 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'ab'");
     17 
     18     var successfullyParsed = true;
     19 
     20 </script>
     21 <script src="../js/resources/js-test-post.js"></script>
     22 </body>
     23 </html>
     24