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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 template<typename SiblingTraversalStrategy> | 93 template<typename SiblingTraversalStrategy> |
94 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy
&) const; | 94 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy
&) const; |
95 | 95 |
96 bool strictParsing() const { return m_strictParsing; } | 96 bool strictParsing() const { return m_strictParsing; } |
97 | 97 |
98 Mode mode() const { return m_mode; } | 98 Mode mode() const { return m_mode; } |
99 | 99 |
100 static bool tagMatches(const Element*, const QualifiedName&); | 100 static bool tagMatches(const Element*, const QualifiedName&); |
101 static bool isCommonPseudoClassSelector(const CSSSelector*); | 101 static bool isCommonPseudoClassSelector(const CSSSelector*); |
102 static bool matchesFocusPseudoClass(const Element*); | 102 static bool matchesFocusPseudoClass(const Element*); |
103 static bool checkExactAttribute(const Element*, const QualifiedName& selecto
rAttributeName, const AtomicStringImpl* value); | 103 static bool checkExactAttribute(const Element*, const QualifiedName& selecto
rAttributeName, const StringImpl* value); |
104 | 104 |
105 enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink |
MatchVisited }; | 105 enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink |
MatchVisited }; |
106 static unsigned determineLinkMatchType(const CSSSelector*); | 106 static unsigned determineLinkMatchType(const CSSSelector*); |
107 | 107 |
108 private: | 108 private: |
109 bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, co
nst CSSSelector*) const; | 109 bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, co
nst CSSSelector*) const; |
110 | 110 |
111 static bool isFrameFocused(const Element*); | 111 static bool isFrameFocused(const Element*); |
112 | 112 |
113 bool m_strictParsing; | 113 bool m_strictParsing; |
(...skipping 16 matching lines...) Expand all Loading... |
130 { | 130 { |
131 if (tagQName == anyQName()) | 131 if (tagQName == anyQName()) |
132 return true; | 132 return true; |
133 const AtomicString& localName = tagQName.localName(); | 133 const AtomicString& localName = tagQName.localName(); |
134 if (localName != starAtom && localName != element->localName()) | 134 if (localName != starAtom && localName != element->localName()) |
135 return false; | 135 return false; |
136 const AtomicString& namespaceURI = tagQName.namespaceURI(); | 136 const AtomicString& namespaceURI = tagQName.namespaceURI(); |
137 return namespaceURI == starAtom || namespaceURI == element->namespaceURI(); | 137 return namespaceURI == starAtom || namespaceURI == element->namespaceURI(); |
138 } | 138 } |
139 | 139 |
140 inline bool SelectorChecker::checkExactAttribute(const Element* element, const Q
ualifiedName& selectorAttributeName, const AtomicStringImpl* value) | 140 inline bool SelectorChecker::checkExactAttribute(const Element* element, const Q
ualifiedName& selectorAttributeName, const StringImpl* value) |
141 { | 141 { |
142 if (!element->hasAttributesWithoutUpdate()) | 142 if (!element->hasAttributesWithoutUpdate()) |
143 return false; | 143 return false; |
144 unsigned size = element->attributeCount(); | 144 unsigned size = element->attributeCount(); |
145 for (unsigned i = 0; i < size; ++i) { | 145 for (unsigned i = 0; i < size; ++i) { |
146 const Attribute* attribute = element->attributeItem(i); | 146 const Attribute* attribute = element->attributeItem(i); |
147 if (attribute->matches(selectorAttributeName) && (!value || attribute->v
alue().impl() == value)) | 147 if (attribute->matches(selectorAttributeName) && (!value || attribute->v
alue().impl() == value)) |
148 return true; | 148 return true; |
149 } | 149 } |
150 return false; | 150 return false; |
151 } | 151 } |
152 | 152 |
153 } | 153 } |
154 | 154 |
155 #endif | 155 #endif |
OLD | NEW |