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

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

Issue 1108993006: Make SelectorChecker::tagMatches internal to the SelectorChecker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 PseudoId dynamicPseudo; 97 PseudoId dynamicPseudo;
98 unsigned specificity; 98 unsigned specificity;
99 }; 99 };
100 100
101 template<typename SiblingTraversalStrategy> 101 template<typename SiblingTraversalStrategy>
102 Match match(const SelectorCheckingContext&, const SiblingTraversalStrategy&, MatchResult* = 0) const; 102 Match match(const SelectorCheckingContext&, const SiblingTraversalStrategy&, MatchResult* = 0) const;
103 103
104 template<typename SiblingTraversalStrategy> 104 template<typename SiblingTraversalStrategy>
105 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy &, unsigned* specificity = 0) const; 105 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy &, unsigned* specificity = 0) const;
106 106
107 static bool tagMatches(const Element&, const QualifiedName&);
108 static bool matchesFocusPseudoClass(const Element&); 107 static bool matchesFocusPseudoClass(const Element&);
109 108
110 private: 109 private:
111 template<typename SiblingTraversalStrategy> 110 template<typename SiblingTraversalStrategy>
112 Match matchForSubSelector(const SelectorCheckingContext&, const SiblingTrave rsalStrategy&, MatchResult*) const; 111 Match matchForSubSelector(const SelectorCheckingContext&, const SiblingTrave rsalStrategy&, MatchResult*) const;
113 template<typename SiblingTraversalStrategy> 112 template<typename SiblingTraversalStrategy>
114 Match matchForRelation(const SelectorCheckingContext&, const SiblingTraversa lStrategy&, MatchResult*) const; 113 Match matchForRelation(const SelectorCheckingContext&, const SiblingTraversa lStrategy&, MatchResult*) const;
115 template<typename SiblingTraversalStrategy> 114 template<typename SiblingTraversalStrategy>
116 Match matchForShadowDistributed(const Element*, const SiblingTraversalStrate gy&, SelectorCheckingContext& nextContext, MatchResult* = 0) const; 115 Match matchForShadowDistributed(const Element*, const SiblingTraversalStrate gy&, SelectorCheckingContext& nextContext, MatchResult* = 0) const;
117 template<typename SiblingTraversalStrategy> 116 template<typename SiblingTraversalStrategy>
118 Match matchForPseudoShadow(const ContainerNode*, const SelectorCheckingConte xt&, const SiblingTraversalStrategy&, MatchResult*) const; 117 Match matchForPseudoShadow(const ContainerNode*, const SelectorCheckingConte xt&, const SiblingTraversalStrategy&, MatchResult*) const;
119 template<typename SiblingTraversalStrategy> 118 template<typename SiblingTraversalStrategy>
120 bool checkPseudoClass(const SelectorCheckingContext&, const SiblingTraversal Strategy&, unsigned* specificity) const; 119 bool checkPseudoClass(const SelectorCheckingContext&, const SiblingTraversal Strategy&, unsigned* specificity) const;
121 template<typename SiblingTraversalStrategy> 120 template<typename SiblingTraversalStrategy>
122 bool checkPseudoElement(const SelectorCheckingContext&, const SiblingTravers alStrategy&) const; 121 bool checkPseudoElement(const SelectorCheckingContext&, const SiblingTravers alStrategy&) const;
123 122
124 bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, co nst CSSSelector&) const; 123 bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, co nst CSSSelector&) const;
125 template<typename SiblingTraversalStrategy> 124 template<typename SiblingTraversalStrategy>
126 bool checkPseudoHost(const SelectorCheckingContext&, const SiblingTraversalS trategy&, unsigned*) const; 125 bool checkPseudoHost(const SelectorCheckingContext&, const SiblingTraversalS trategy&, unsigned*) const;
127 126
128 Mode m_mode; 127 Mode m_mode;
129 }; 128 };
130 129
131 inline bool SelectorChecker::tagMatches(const Element& element, const QualifiedN ame& tagQName)
132 {
133 if (tagQName == anyQName())
134 return true;
135 const AtomicString& localName = tagQName.localName();
136 if (localName != starAtom && localName != element.localName())
137 return false;
138 const AtomicString& namespaceURI = tagQName.namespaceURI();
139 return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
140 }
141
142 } 130 }
143 131
144 #endif 132 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698