Changeset 19697 in webkit


Ignore:
Timestamp:
Feb 18, 2007 1:07:30 PM (17 years ago)
Author:
ap
Message:

Reviewed by Adele.

http://bugs.webkit.org/show_bug.cgi?id=12807
XPath incorrectly converts NaN to boolean

Test: fast/xpath/nan-to-boolean.html

  • xml/XPathValue.cpp: (WebCore::XPath::Value::toBoolean): Convert NaN to false.
  • xml/XPathFunctions.cpp: (WebCore::XPath::FunSubstringAfter::doEvaluate): Fix substring-after to actually work.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19696 r19697  
     12007-02-18  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Adele.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=12807
     6        XPath incorrectly converts NaN to boolean
     7
     8        * fast/xpath/nan-to-boolean-expected.txt: Added.
     9        * fast/xpath/nan-to-boolean.html: Added.
     10
    1112007-02-18  Mitz Pettel  <mitz@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r19696 r19697  
     12007-02-18  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Adele.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=12807
     6        XPath incorrectly converts NaN to boolean
     7
     8        Test: fast/xpath/nan-to-boolean.html
     9
     10        * xml/XPathValue.cpp:
     11        (WebCore::XPath::Value::toBoolean): Convert NaN to false.
     12        * xml/XPathFunctions.cpp:
     13        (WebCore::XPath::FunSubstringAfter::doEvaluate): Fix substring-after to actually work.
     14
    1152007-02-18  Mitz Pettel  <mitz@webkit.org>
    216
  • trunk/WebCore/xml/XPathFunctions.cpp

    r19467 r19697  
    505505        return "";
    506506
    507     return s1.substring(i + 1);
     507    return s1.substring(s2.length());
    508508}
    509509
  • trunk/WebCore/xml/XPathValue.cpp

    r19225 r19697  
    9696            return m_bool;
    9797        case NumberValue:
    98             return m_number != 0;
     98            return m_number != 0 && !isnan(m_number);
    9999        case StringValue:
    100100            return !m_string.isEmpty();
Note: See TracChangeset for help on using the changeset viewer.