Changeset 140677 in webkit


Ignore:
Timestamp:
Jan 24, 2013 5:14:04 AM (11 years ago)
Author:
akling@apple.com
Message:

Add CSSSelectorList::isValid().
<http://webkit.org/b/107809>

Reviewed by Antti Koivisto.

Add an isValid() method to CSSSelectorList and use that where applicable instead of checking
if first() is a null pointer.

  • css/CSSPageRule.cpp:

(WebCore::CSSPageRule::setSelectorText):

  • css/CSSSelectorList.cpp:
  • css/CSSSelectorList.h:

(WebCore::CSSSelectorList::isValid):
(WebCore::CSSSelectorList::first):
(CSSSelectorList):

  • css/CSSStyleRule.cpp:

(WebCore::CSSStyleRule::setSelectorText):

  • html/shadow/HTMLContentElement.cpp:

(WebCore::HTMLContentElement::validateSelect):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::checkStyleRuleSelector):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140675 r140677  
     12013-01-24  Andreas Kling  <akling@apple.com>
     2
     3        Add CSSSelectorList::isValid().
     4        <http://webkit.org/b/107809>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add an isValid() method to CSSSelectorList and use that where applicable instead of checking
     9        if first() is a null pointer.
     10
     11        * css/CSSPageRule.cpp:
     12        (WebCore::CSSPageRule::setSelectorText):
     13        * css/CSSSelectorList.cpp:
     14        * css/CSSSelectorList.h:
     15        (WebCore::CSSSelectorList::isValid):
     16        (WebCore::CSSSelectorList::first):
     17        (CSSSelectorList):
     18        * css/CSSStyleRule.cpp:
     19        (WebCore::CSSStyleRule::setSelectorText):
     20        * html/shadow/HTMLContentElement.cpp:
     21        (WebCore::HTMLContentElement::validateSelect):
     22        * inspector/InspectorStyleSheet.cpp:
     23        (WebCore::checkStyleRuleSelector):
     24
    1252013-01-24  Kai Koehne  <kai.koehne@digia.com>
    226
  • trunk/Source/WebCore/css/CSSPageRule.cpp

    r135465 r140677  
    7474    CSSSelectorList selectorList;
    7575    parser.parseSelector(selectorText, selectorList);
    76     if (!selectorList.first())
     76    if (!selectorList.isValid())
    7777        return;
    7878
  • trunk/Source/WebCore/css/CSSSelectorList.h

    r140530 r140677  
    4444    void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectorVector);
    4545
    46     const CSSSelector* first() const { return m_selectorArray ? m_selectorArray : 0; }
     46    bool isValid() const { return !!m_selectorArray; }
     47    const CSSSelector* first() const { return m_selectorArray; }
    4748    static const CSSSelector* next(const CSSSelector*);
    4849    bool hasOneSelector() const { return m_selectorArray && !next(m_selectorArray); }
  • trunk/Source/WebCore/css/CSSStyleRule.cpp

    r140530 r140677  
    9797    CSSSelectorList selectorList;
    9898    p.parseSelector(selectorText, selectorList);
    99     if (!selectorList.first())
     99    if (!selectorList.isValid())
    100100        return;
    101101
  • trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp

    r140530 r140677  
    193193        return true;
    194194
    195     if (!m_selectorList.first())
     195    if (!m_selectorList.isValid())
    196196        return false;
    197197
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r140530 r140677  
    832832    CSSSelectorList selectorList;
    833833    createCSSParser(document)->parseSelector(selector, selectorList);
    834     return selectorList.first();
     834    return selectorList.isValid();
    835835}
    836836
Note: See TracChangeset for help on using the changeset viewer.