X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fcss%2FCSSSelectorList.h;h=f90b28722973b7cd6e49f27490687566b52ed7c1;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=320de3b4175db62f71e2688b7d710b5b5799d368;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/css/CSSSelectorList.h b/src/third_party/WebKit/Source/core/css/CSSSelectorList.h index 320de3b..f90b287 100644 --- a/src/third_party/WebKit/Source/core/css/CSSSelectorList.h +++ b/src/third_party/WebKit/Source/core/css/CSSSelectorList.h @@ -45,17 +45,17 @@ public: bool isValid() const { return !!m_selectorArray; } const CSSSelector* first() const { return m_selectorArray; } - static const CSSSelector* next(const CSSSelector*); - bool hasOneSelector() const { return m_selectorArray && !next(m_selectorArray); } - const CSSSelector* selectorAt(size_t index) const { return &m_selectorArray[index]; } + static const CSSSelector* next(const CSSSelector&); + bool hasOneSelector() const { return m_selectorArray && !next(*m_selectorArray); } + const CSSSelector& selectorAt(size_t index) const { return m_selectorArray[index]; } size_t indexOfNextSelectorAfter(size_t index) const { - const CSSSelector* current = selectorAt(index); - current = next(current); - if (!current) + const CSSSelector& current = selectorAt(index); + const CSSSelector* next = this->next(current); + if (!next) return kNotFound; - return current - m_selectorArray; + return next - m_selectorArray; } bool selectorsNeedNamespaceResolution(); @@ -77,12 +77,13 @@ private: CSSSelector* m_selectorArray; }; -inline const CSSSelector* CSSSelectorList::next(const CSSSelector* current) +inline const CSSSelector* CSSSelectorList::next(const CSSSelector& current) { // Skip subparts of compound selectors. - while (!current->isLastInTagHistory()) - current++; - return current->isLastInSelectorList() ? 0 : current + 1; + const CSSSelector* last = ¤t; + while (!last->isLastInTagHistory()) + last++; + return last->isLastInSelectorList() ? 0 : last + 1; } } // namespace WebCore