X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fcss%2FSelectorFilter.cpp;h=352ae8fd6464a1701062d21e5266baa370b88638;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=50d13de6b484eb6b674dec0f98941480778cc008;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/css/SelectorFilter.cpp b/src/third_party/WebKit/Source/core/css/SelectorFilter.cpp index 50d13de..352ae8f 100644 --- a/src/third_party/WebKit/Source/core/css/SelectorFilter.cpp +++ b/src/third_party/WebKit/Source/core/css/SelectorFilter.cpp @@ -108,41 +108,41 @@ 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.m_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: @@ -160,13 +160,13 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsign case CSSSelector::ChildTree: case CSSSelector::DescendantTree: 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; }