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

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

Issue 1099963003: Support type selector for camel-cased SVG elements in HTML. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase issue. querySelector didn't use tagMatches anymore. 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
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!equalIgnoringCase(localName, element.localName()))
106 return false;
107 }
104 const AtomicString& namespaceURI = tagQName.namespaceURI(); 108 const AtomicString& namespaceURI = tagQName.namespaceURI();
105 return namespaceURI == starAtom || namespaceURI == element.namespaceURI(); 109 return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
106 } 110 }
107 111
108 static Element* parentElement(const SelectorChecker::SelectorCheckingContext& co ntext) 112 static Element* parentElement(const SelectorChecker::SelectorCheckingContext& co ntext)
109 { 113 {
110 // - If context.scope is a shadow root, we should walk up to its shadow host . 114 // - 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, 115 // - If context.scope is some element in some shadow tree and querySelector initialized the context,
112 // e.g. shadowRoot.querySelector(':host *'), 116 // 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. 117 // (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
1138 return element.focused() && isFrameFocused(element); 1142 return element.focused() && isFrameFocused(element);
1139 } 1143 }
1140 1144
1141 template 1145 template
1142 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const; 1146 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const;
1143 1147
1144 template 1148 template
1145 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; 1149 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const;
1146 1150
1147 } 1151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698