Changeset 58300 in webkit


Ignore:
Timestamp:
Apr 27, 2010 2:53:27 AM (14 years ago)
Author:
yuzo@google.com
Message:

2010-04-27 Yuzo Fujishima <yuzo@google.com>

Reviewed by Shinichiro Hamaji.

WebCore::CSSSelector::RareData::parseNth doesn't check whether the search for '-' in the argument was successful.
This results in incorrect parsing.
For example, '3n' is parsed as if it were '3n-3'. The code has been working OK just accidentally.

https://bugs.webkit.org/show_bug.cgi?id=37787

No new tests are added because the original behavior is accidentally OK.

  • css/CSSSelector.cpp: (WebCore::CSSSelector::RareData::parseNth):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58299 r58300  
     12010-04-27  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        WebCore::CSSSelector::RareData::parseNth doesn't check whether the search for '-' in the argument was successful.
     6        This results in incorrect parsing.
     7        For example, '3n' is parsed as if it were '3n-3'. The code has been working OK just accidentally.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=37787
     10
     11        No new tests are added because the original behavior is accidentally OK.
     12
     13        * css/CSSSelector.cpp:
     14        (WebCore::CSSSelector::RareData::parseNth):
     15
    1162010-04-27  Yuzo Fujishima  <yuzo@google.com>
    217
  • trunk/WebCore/css/CSSSelector.cpp

    r58299 r58300  
    774774            else {
    775775                p = argument.find('-', n);
    776                 m_b = -argument.substring(p + 1, argument.length() - p - 1).toInt();
     776                if (p != -1)
     777                    m_b = -argument.substring(p + 1, argument.length() - p - 1).toInt();
    777778            }
    778779        } else
Note: See TracChangeset for help on using the changeset viewer.