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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 static bool matchesListBoxPseudoClass(const Element& element) | 92 static bool matchesListBoxPseudoClass(const Element& element) |
93 { | 93 { |
94 return isHTMLSelectElement(element) && !toHTMLSelectElement(element).usesMen
uList(); | 94 return isHTMLSelectElement(element) && !toHTMLSelectElement(element).usesMen
uList(); |
95 } | 95 } |
96 | 96 |
97 static bool matchesTagName(const Element& element, const QualifiedName& tagQName
) | 97 static bool matchesTagName(const Element& element, const QualifiedName& tagQName
) |
98 { | 98 { |
99 if (tagQName == anyQName()) | 99 if (tagQName == anyQName()) |
100 return true; | 100 return true; |
101 const AtomicString& localName = tagQName.localName(); | 101 const AtomicString& localName = tagQName.localName(); |
102 if (localName != starAtom && localName != element.localName()) | 102 if (localName != starAtom && localName != element.localName()) { |
103 return false; | 103 if (element.isHTMLElement() || !element.document().isHTMLDocument()) |
| 104 return false; |
| 105 // Non-html elements in html documents are normalized to their camel-cas
ed |
| 106 // version during parsing if applicable. Yet, type selectors are lower-c
ased |
| 107 // for selectors in html documents. Try a case-insensitive match below t
o |
| 108 // allow type selector matching for such elements. |
| 109 if (!equalIgnoringCase(localName, element.localName())) |
| 110 return false; |
| 111 } |
104 const AtomicString& namespaceURI = tagQName.namespaceURI(); | 112 const AtomicString& namespaceURI = tagQName.namespaceURI(); |
105 return namespaceURI == starAtom || namespaceURI == element.namespaceURI(); | 113 return namespaceURI == starAtom || namespaceURI == element.namespaceURI(); |
106 } | 114 } |
107 | 115 |
108 static Element* parentElement(const SelectorChecker::SelectorCheckingContext& co
ntext) | 116 static Element* parentElement(const SelectorChecker::SelectorCheckingContext& co
ntext) |
109 { | 117 { |
110 // - If context.scope is a shadow root, we should walk up to its shadow host
. | 118 // - If context.scope is a shadow root, we should walk up to its shadow host
. |
111 // - If context.scope is some element in some shadow tree and querySelector
initialized the context, | 119 // - If context.scope is some element in some shadow tree and querySelector
initialized the context, |
112 // e.g. shadowRoot.querySelector(':host *'), | 120 // e.g. shadowRoot.querySelector(':host *'), |
113 // (a) context.element has the same treescope as context.scope, need to wa
lk up to its shadow host. | 121 // (a) context.element has the same treescope as context.scope, need to wa
lk up to its shadow host. |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 return element.focused() && isFrameFocused(element); | 1146 return element.focused() && isFrameFocused(element); |
1139 } | 1147 } |
1140 | 1148 |
1141 template | 1149 template |
1142 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; | 1150 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; |
1143 | 1151 |
1144 template | 1152 template |
1145 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; | 1153 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; |
1146 | 1154 |
1147 } | 1155 } |
OLD | NEW |