OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |