Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: Source/core/css/SelectorChecker.h

Issue 847773003: Removing dead code SelectorChecker::checkExactAttribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 bool strictParsing() const { return m_strictParsing; } 106 bool strictParsing() const { return m_strictParsing; }
107 107
108 Mode mode() const { return m_mode; } 108 Mode mode() const { return m_mode; }
109 109
110 static bool tagMatches(const Element&, const QualifiedName&); 110 static bool tagMatches(const Element&, const QualifiedName&);
111 static bool isCommonPseudoClassSelector(const CSSSelector&); 111 static bool isCommonPseudoClassSelector(const CSSSelector&);
112 static bool matchesFocusPseudoClass(const Element&); 112 static bool matchesFocusPseudoClass(const Element&);
113 static bool matchesSpatialNavigationFocusPseudoClass(const Element&); 113 static bool matchesSpatialNavigationFocusPseudoClass(const Element&);
114 static bool matchesListBoxPseudoClass(const Element&); 114 static bool matchesListBoxPseudoClass(const Element&);
115 static bool checkExactAttribute(const Element&, const QualifiedName& selecto rAttributeName, const StringImpl* value);
116 115
117 enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited }; 116 enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited };
118 static unsigned determineLinkMatchType(const CSSSelector&); 117 static unsigned determineLinkMatchType(const CSSSelector&);
119 118
120 static bool isHostInItsShadowTree(const Element&, const ContainerNode* scope ); 119 static bool isHostInItsShadowTree(const Element&, const ContainerNode* scope );
121 120
122 private: 121 private:
123 template<typename SiblingTraversalStrategy> 122 template<typename SiblingTraversalStrategy>
124 Match matchForSubSelector(const SelectorCheckingContext&, const SiblingTrave rsalStrategy&, MatchResult*) const; 123 Match matchForSubSelector(const SelectorCheckingContext&, const SiblingTrave rsalStrategy&, MatchResult*) const;
125 template<typename SiblingTraversalStrategy> 124 template<typename SiblingTraversalStrategy>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 { 157 {
159 if (tagQName == anyQName()) 158 if (tagQName == anyQName())
160 return true; 159 return true;
161 const AtomicString& localName = tagQName.localName(); 160 const AtomicString& localName = tagQName.localName();
162 if (localName != starAtom && localName != element.localName()) 161 if (localName != starAtom && localName != element.localName())
163 return false; 162 return false;
164 const AtomicString& namespaceURI = tagQName.namespaceURI(); 163 const AtomicString& namespaceURI = tagQName.namespaceURI();
165 return namespaceURI == starAtom || namespaceURI == element.namespaceURI(); 164 return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
166 } 165 }
167 166
168 inline bool SelectorChecker::checkExactAttribute(const Element& element, const Q ualifiedName& selectorAttributeName, const StringImpl* value)
169 {
170 for (const auto& attribute : element.attributesWithoutUpdate()) {
171 if (attribute.matches(selectorAttributeName) && (!value || attribute.val ue().impl() == value))
172 return true;
173 }
174 return false;
175 }
176
177 inline bool SelectorChecker::isHostInItsShadowTree(const Element& element, const ContainerNode* scope) 167 inline bool SelectorChecker::isHostInItsShadowTree(const Element& element, const ContainerNode* scope)
178 { 168 {
179 return scope && scope->isInShadowTree() && scope->shadowHost() == element; 169 return scope && scope->isInShadowTree() && scope->shadowHost() == element;
180 } 170 }
181 171
182 } 172 }
183 173
184 #endif 174 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698