diff options
author | Ben Murdoch <benm@google.com> | 2010-06-23 19:01:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-09 15:43:53 +0100 |
commit | ed49531d2d6aa65c37a129aee55887dff1cf188b (patch) | |
tree | 15c7e66c4b46514d8c8741ea691109bbc375d784 /WebCore/xml | |
parent | 92f452b0082ffac909a4d1d2eac4d015f53edfe4 (diff) | |
download | external_webkit-ed49531d2d6aa65c37a129aee55887dff1cf188b.zip external_webkit-ed49531d2d6aa65c37a129aee55887dff1cf188b.tar.gz external_webkit-ed49531d2d6aa65c37a129aee55887dff1cf188b.tar.bz2 |
Fix fast/xpath layout test failures.
These failures are caused by
https://bugs.webkit.org/show_bug.cgi?id=41862 and this patch is a
cherry pick of the patch attached to that bug.
Change-Id: I9c897086a7a2903aaa6a11da5fb95b81086287cc
Diffstat (limited to 'WebCore/xml')
-rw-r--r-- | WebCore/xml/XPathFunctions.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/WebCore/xml/XPathFunctions.cpp b/WebCore/xml/XPathFunctions.cpp index 1089f7c..a727680 100644 --- a/WebCore/xml/XPathFunctions.cpp +++ b/WebCore/xml/XPathFunctions.cpp @@ -500,7 +500,10 @@ Value FunSubstringAfter::evaluate() const Value FunSubstring::evaluate() const { String s = arg(0)->evaluate().toString(); - long pos = static_cast<long>(FunRound::round(arg(1)->evaluate().toNumber())); + double doublePos = arg(1)->evaluate().toNumber(); + if (isnan(doublePos)) + return ""; + long pos = static_cast<long>(FunRound::round(doublePos)); bool haveLength = argCount() == 3; long len = -1; if (haveLength) { |