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

Side by Side Diff: Source/core/dom/Node.h

Issue 406843002: Optimize hasTagName when called on an HTMLElement / SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/dom/ElementTraversal.h ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('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) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class DOMSettableTokenList; 50 class DOMSettableTokenList;
51 class Document; 51 class Document;
52 class Element; 52 class Element;
53 class Event; 53 class Event;
54 class EventDispatchMediator; 54 class EventDispatchMediator;
55 class EventListener; 55 class EventListener;
56 class ExceptionState; 56 class ExceptionState;
57 class FloatPoint; 57 class FloatPoint;
58 class LocalFrame; 58 class LocalFrame;
59 class HTMLInputElement; 59 class HTMLInputElement;
60 class HTMLQualifiedName;
60 class IntRect; 61 class IntRect;
61 class KeyboardEvent; 62 class KeyboardEvent;
62 class NSResolver; 63 class NSResolver;
63 class NameNodeList; 64 class NameNodeList;
64 class NamedNodeMap; 65 class NamedNodeMap;
65 class NodeEventContext; 66 class NodeEventContext;
66 class NodeList; 67 class NodeList;
67 class NodeListsNodeData; 68 class NodeListsNodeData;
68 class NodeRareData; 69 class NodeRareData;
69 class PlatformGestureEvent; 70 class PlatformGestureEvent;
70 class PlatformKeyboardEvent; 71 class PlatformKeyboardEvent;
71 class PlatformMouseEvent; 72 class PlatformMouseEvent;
72 class PlatformWheelEvent; 73 class PlatformWheelEvent;
73 class QualifiedName; 74 class QualifiedName;
74 class RadioNodeList; 75 class RadioNodeList;
75 class RegisteredEventListener; 76 class RegisteredEventListener;
76 class RenderBox; 77 class RenderBox;
77 class RenderBoxModelObject; 78 class RenderBoxModelObject;
78 class RenderObject; 79 class RenderObject;
79 class RenderStyle; 80 class RenderStyle;
81 class SVGQualifiedName;
80 class ShadowRoot; 82 class ShadowRoot;
81 class StaticNodeList; 83 class StaticNodeList;
82 class TagCollection; 84 class TagCollection;
83 class Text; 85 class Text;
84 class TouchEvent; 86 class TouchEvent;
85 class WeakNodeMap; 87 class WeakNodeMap;
86 88
87 const int nodeStyleChangeShift = 19; 89 const int nodeStyleChangeShift = 19;
88 90
89 enum StyleChangeType { 91 enum StyleChangeType {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void operator delete(void*); 165 void operator delete(void*);
164 #endif 166 #endif
165 167
166 static void dumpStatistics(); 168 static void dumpStatistics();
167 169
168 virtual ~Node(); 170 virtual ~Node();
169 171
170 // DOM methods & attributes for Node 172 // DOM methods & attributes for Node
171 173
172 bool hasTagName(const QualifiedName&) const; 174 bool hasTagName(const QualifiedName&) const;
175 bool hasTagName(const HTMLQualifiedName&) const;
176 bool hasTagName(const SVGQualifiedName&) const;
173 virtual String nodeName() const = 0; 177 virtual String nodeName() const = 0;
174 virtual String nodeValue() const; 178 virtual String nodeValue() const;
175 virtual void setNodeValue(const String&); 179 virtual void setNodeValue(const String&);
176 virtual NodeType nodeType() const = 0; 180 virtual NodeType nodeType() const = 0;
177 ContainerNode* parentNode() const; 181 ContainerNode* parentNode() const;
178 Element* parentElement() const; 182 Element* parentElement() const;
179 ContainerNode* parentElementOrShadowRoot() const; 183 ContainerNode* parentElementOrShadowRoot() const;
180 ContainerNode* parentElementOrDocumentFragment() const; 184 ContainerNode* parentElementOrDocumentFragment() const;
181 Node* previousSibling() const { return m_previous; } 185 Node* previousSibling() const { return m_previous; }
182 Node* nextSibling() const { return m_next; } 186 Node* nextSibling() const { return m_next; }
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 } // namespace blink 908 } // namespace blink
905 909
906 #ifndef NDEBUG 910 #ifndef NDEBUG
907 // Outside the WebCore namespace for ease of invocation from gdb. 911 // Outside the WebCore namespace for ease of invocation from gdb.
908 void showNode(const blink::Node*); 912 void showNode(const blink::Node*);
909 void showTree(const blink::Node*); 913 void showTree(const blink::Node*);
910 void showNodePath(const blink::Node*); 914 void showNodePath(const blink::Node*);
911 #endif 915 #endif
912 916
913 #endif 917 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/ElementTraversal.h ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698