summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css/CSSSelectorList.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/css/CSSSelectorList.h
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/css/CSSSelectorList.h')
-rw-r--r--Source/WebCore/css/CSSSelectorList.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WebCore/css/CSSSelectorList.h b/Source/WebCore/css/CSSSelectorList.h
index abd9bc8..2b96d92 100644
--- a/Source/WebCore/css/CSSSelectorList.h
+++ b/Source/WebCore/css/CSSSelectorList.h
@@ -30,6 +30,8 @@
namespace WebCore {
+class CSSParserSelector;
+
class CSSSelectorList {
WTF_MAKE_NONCOPYABLE(CSSSelectorList); WTF_MAKE_FAST_ALLOCATED;
public:
@@ -37,11 +39,11 @@ public:
~CSSSelectorList();
void adopt(CSSSelectorList& list);
- void adoptSelectorVector(Vector<CSSSelector*>& selectorVector);
+ void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectorVector);
CSSSelector* first() const { return m_selectorArray ? m_selectorArray : 0; }
- static CSSSelector* next(CSSSelector* previous) { return previous->isLastInSelectorList() ? 0 : previous + 1; }
- bool hasOneSelector() const { return m_selectorArray ? m_selectorArray->isLastInSelectorList() : false; }
+ static CSSSelector* next(CSSSelector*);
+ bool hasOneSelector() const { return m_selectorArray && !next(m_selectorArray); }
bool selectorsNeedNamespaceResolution();
bool hasUnknownPseudoElements() const;
@@ -49,10 +51,19 @@ public:
private:
void deleteSelectors();
+ // End of a multipart selector is indicated by m_isLastInTagHistory bit in the last item.
// End of the array is indicated by m_isLastInSelectorList bit in the last item.
CSSSelector* m_selectorArray;
};
+inline CSSSelector* CSSSelectorList::next(CSSSelector* current)
+{
+ // Skip subparts of compound selectors.
+ while (!current->isLastInTagHistory())
+ current++;
+ return current->isLastInSelectorList() ? 0 : current + 1;
+}
+
} // namespace WebCore
#endif // CSSSelectorList_h