diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp b/chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp index 50d13de6b48..c0c6a97a16a 100644 --- a/chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp +++ b/chromium/third_party/WebKit/Source/core/css/SelectorFilter.cpp @@ -108,45 +108,44 @@ void SelectorFilter::pushParent(Element& parent) pushParentStackFrame(parent); } -static inline void collectDescendantSelectorIdentifierHashes(const CSSSelector* selector, unsigned*& hash) +static inline void collectDescendantSelectorIdentifierHashes(const CSSSelector& selector, unsigned*& hash) { - switch (selector->m_match) { + switch (selector.match()) { case CSSSelector::Id: - if (!selector->value().isEmpty()) - (*hash++) = selector->value().impl()->existingHash() * IdAttributeSalt; + if (!selector.value().isEmpty()) + (*hash++) = selector.value().impl()->existingHash() * IdAttributeSalt; break; case CSSSelector::Class: - if (!selector->value().isEmpty()) - (*hash++) = selector->value().impl()->existingHash() * ClassAttributeSalt; + if (!selector.value().isEmpty()) + (*hash++) = selector.value().impl()->existingHash() * ClassAttributeSalt; break; case CSSSelector::Tag: - if (selector->tagQName().localName() != starAtom) - (*hash++) = selector->tagQName().localName().impl()->existingHash() * TagNameSalt; + if (selector.tagQName().localName() != starAtom) + (*hash++) = selector.tagQName().localName().impl()->existingHash() * TagNameSalt; break; default: break; } } -void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsigned* identifierHashes, unsigned maximumIdentifierCount) +void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsigned* identifierHashes, unsigned maximumIdentifierCount) { unsigned* hash = identifierHashes; unsigned* end = identifierHashes + maximumIdentifierCount; - CSSSelector::Relation relation = selector->relation(); - bool relationIsAffectedByPseudoContent = selector->relationIsAffectedByPseudoContent(); + CSSSelector::Relation relation = selector.relation(); + bool relationIsAffectedByPseudoContent = selector.relationIsAffectedByPseudoContent(); // Skip the topmost selector. It is handled quickly by the rule hashes. bool skipOverSubselectors = true; - for (selector = selector->tagHistory(); selector; selector = selector->tagHistory()) { + for (const CSSSelector* current = selector.tagHistory(); current; current = current->tagHistory()) { // Only collect identifiers that match ancestors. switch (relation) { case CSSSelector::SubSelector: if (!skipOverSubselectors) - collectDescendantSelectorIdentifierHashes(selector, hash); + collectDescendantSelectorIdentifierHashes(*current, hash); break; case CSSSelector::DirectAdjacent: case CSSSelector::IndirectAdjacent: - case CSSSelector::ShadowPseudo: skipOverSubselectors = true; break; case CSSSelector::Descendant: @@ -157,16 +156,16 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsign return; } // Fall through. - case CSSSelector::ChildTree: - case CSSSelector::DescendantTree: + case CSSSelector::ShadowPseudo: + case CSSSelector::ShadowDeep: skipOverSubselectors = false; - collectDescendantSelectorIdentifierHashes(selector, hash); + collectDescendantSelectorIdentifierHashes(*current, hash); break; } if (hash == end) return; - relation = selector->relation(); - relationIsAffectedByPseudoContent = selector->relationIsAffectedByPseudoContent(); + relation = current->relation(); + relationIsAffectedByPseudoContent = current->relationIsAffectedByPseudoContent(); } *hash = 0; } |