Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xpath / substring-nan-position.html
blob9ac567c8b8a4437d7227ce88b9ad0287f57dce15
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41862">bug 41862</a>:
8 XPath substring function is broken when passing NaN as the position parameter.</p>
9 <div id="console"></div>
11 <script>
12 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
13 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), 3)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
15 <!-- -2147483645 represents MIN_INT-3 which when passed through the original substring function before the fix for 41862 landed caused an overflow and wrap to 2. That meant that this case was effectively calling substring('12345', MIN_INT, 2) and returning 12, rather than the empty string which the NaN should have triggered.. -->
16 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), -2147483645)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
18 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), number(\'NaN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
20 </script>
21 </body>
22 </html>