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

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

Issue 1099963003: Support type selector for camel-cased SVG elements in HTML. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review issues. 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 | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.h » ('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 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 12 matching lines...) Expand all
23 * You should have received a copy of the GNU Library General Public License 23 * You should have received a copy of the GNU Library General Public License
24 * along with this library; see the file COPYING.LIB. If not, write to 24 * along with this library; see the file COPYING.LIB. If not, write to
25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 * Boston, MA 02110-1301, USA. 26 * Boston, MA 02110-1301, USA.
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/css/SelectorFilter.h" 30 #include "core/css/SelectorFilter.h"
31 31
32 #include "core/css/CSSSelector.h" 32 #include "core/css/CSSSelector.h"
33 #include "core/dom/Document.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 // Salt to separate otherwise identical string hashes so a class-selector like . article won't match <article> elements. 37 // Salt to separate otherwise identical string hashes so a class-selector like . article won't match <article> elements.
37 enum { TagNameSalt = 13, IdAttributeSalt = 17, ClassAttributeSalt = 19 }; 38 enum { TagNameSalt = 13, IdAttributeSalt = 17, ClassAttributeSalt = 19 };
38 39
39 static inline void collectElementIdentifierHashes(const Element& element, Vector <unsigned, 4>& identifierHashes) 40 static inline void collectElementIdentifierHashes(const Element& element, Vector <unsigned, 4>& identifierHashes)
40 { 41 {
41 identifierHashes.append(element.localName().impl()->existingHash() * TagName Salt); 42 identifierHashes.append(element.localNameForSelectorMatching().impl()->exist ingHash() * TagNameSalt);
42 if (element.hasID()) 43 if (element.hasID())
43 identifierHashes.append(element.idForStyleResolution().impl()->existingH ash() * IdAttributeSalt); 44 identifierHashes.append(element.idForStyleResolution().impl()->existingH ash() * IdAttributeSalt);
44 if (element.isStyledElement() && element.hasClass()) { 45 if (element.isStyledElement() && element.hasClass()) {
45 const SpaceSplitString& classNames = element.classNames(); 46 const SpaceSplitString& classNames = element.classNames();
46 size_t count = classNames.size(); 47 size_t count = classNames.size();
47 for (size_t i = 0; i < count; ++i) 48 for (size_t i = 0; i < count; ++i)
48 identifierHashes.append(classNames[i].impl()->existingHash() * Class AttributeSalt); 49 identifierHashes.append(classNames[i].impl()->existingHash() * Class AttributeSalt);
49 } 50 }
50 } 51 }
51 52
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 177 }
177 178
178 DEFINE_TRACE(SelectorFilter) 179 DEFINE_TRACE(SelectorFilter)
179 { 180 {
180 #if ENABLE(OILPAN) 181 #if ENABLE(OILPAN)
181 visitor->trace(m_parentStack); 182 visitor->trace(m_parentStack);
182 #endif 183 #endif
183 } 184 }
184 185
185 } 186 }
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698