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

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

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
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-2011, 2014 Apple Inc. All rights 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
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 WILL_NOT_BE_EAGERLY_TRACED_CLASS(Node); 131 WILL_NOT_BE_EAGERLY_TRACED_CLASS(Node);
132 132
133 // This class represents a DOM node in the DOM tree. 133 // This class represents a DOM node in the DOM tree.
134 // https://dom.spec.whatwg.org/#interface-node 134 // https://dom.spec.whatwg.org/#interface-node
135 class CORE_EXPORT Node : public EventTarget { 135 class CORE_EXPORT Node : public EventTarget {
136 DEFINE_WRAPPERTYPEINFO(); 136 DEFINE_WRAPPERTYPEINFO();
137 friend class TreeScope; 137 friend class TreeScope;
138 friend class TreeScopeAdopter; 138 friend class TreeScopeAdopter;
139 public: 139 public:
140 enum NodeType { 140 enum NodeType {
141 ELEMENT_NODE = 1, 141 kElementNode = 1,
142 ATTRIBUTE_NODE = 2, 142 kAttributeNode = 2,
143 TEXT_NODE = 3, 143 kTextNode = 3,
144 CDATA_SECTION_NODE = 4, 144 kCdataSectionNode = 4,
145 PROCESSING_INSTRUCTION_NODE = 7, 145 kProcessingInstructionNode = 7,
146 COMMENT_NODE = 8, 146 kCommentNode = 8,
147 DOCUMENT_NODE = 9, 147 kDocumentNode = 9,
148 DOCUMENT_TYPE_NODE = 10, 148 kDocumentTypeNode = 10,
149 DOCUMENT_FRAGMENT_NODE = 11, 149 kDocumentFragmentNode = 11,
150 }; 150 };
151 151
152 // Entity, EntityReference, Notation, and XPathNamespace nodes are impossibl e to create in Blink. 152 // Entity, EntityReference, and Notation nodes are impossible to create in B link.
153 // But for compatibility reasons we want these enum values exist in JS, and this enum makes the bindings 153 // But for compatibility reasons we want these enum values exist in JS, and this enum makes the bindings
154 // generation not complain about ENTITY_REFERENCE_NODE being missing from th e implementation 154 // generation not complain about kEntityReferenceNode being missing from the implementation
155 // while not requiring all switch(NodeType) blocks to include this deprecate d constant. 155 // while not requiring all switch(NodeType) blocks to include this deprecate d constant.
156 enum DeprecatedNodeType { 156 enum DeprecatedNodeType {
157 ENTITY_REFERENCE_NODE = 5, 157 kEntityReferenceNode = 5,
158 ENTITY_NODE = 6, 158 kEntityNode = 6,
159 NOTATION_NODE = 12, 159 kNotationNode = 12,
160 XPATH_NAMESPACE_NODE = 13,
161 }; 160 };
162 161
163 enum DocumentPosition { 162 enum DocumentPosition {
164 DOCUMENT_POSITION_EQUIVALENT = 0x00, 163 kDocumentPositionEquivalent = 0x00,
165 DOCUMENT_POSITION_DISCONNECTED = 0x01, 164 kDocumentPositionDisconnected = 0x01,
166 DOCUMENT_POSITION_PRECEDING = 0x02, 165 kDocumentPositionPreceding = 0x02,
167 DOCUMENT_POSITION_FOLLOWING = 0x04, 166 kDocumentPositionFollowing = 0x04,
168 DOCUMENT_POSITION_CONTAINS = 0x08, 167 kDocumentPositionContains = 0x08,
169 DOCUMENT_POSITION_CONTAINED_BY = 0x10, 168 kDocumentPositionContainedBy = 0x10,
170 DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20, 169 kDocumentPositionImplementationSpecific = 0x20,
171 }; 170 };
172 171
173 // Override operator new to allocate Node subtype objects onto 172 // Override operator new to allocate Node subtype objects onto
174 // a dedicated heap. 173 // a dedicated heap.
175 GC_PLUGIN_IGNORE("crbug.com/443854") 174 GC_PLUGIN_IGNORE("crbug.com/443854")
176 void* operator new(size_t size) 175 void* operator new(size_t size)
177 { 176 {
178 return allocateObject(size, false); 177 return allocateObject(size, false);
179 } 178 }
180 static void* allocateObject(size_t size, bool isEager) 179 static void* allocateObject(size_t size, bool isEager)
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); } 456 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); }
458 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(IsConnect edFlag | IsInShadowTreeFlag)); } 457 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(IsConnect edFlag | IsInShadowTreeFlag)); }
459 458
460 ElementShadow* parentElementShadow() const; 459 ElementShadow* parentElementShadow() const;
461 bool isInV1ShadowTree() const; 460 bool isInV1ShadowTree() const;
462 bool isInV0ShadowTree() const; 461 bool isInV0ShadowTree() const;
463 bool isChildOfV1ShadowHost() const; 462 bool isChildOfV1ShadowHost() const;
464 bool isChildOfV0ShadowHost() const; 463 bool isChildOfV0ShadowHost() const;
465 ShadowRoot* v1ShadowRootOfParent() const; 464 ShadowRoot* v1ShadowRootOfParent() const;
466 465
467 bool isDocumentTypeNode() const { return getNodeType() == DOCUMENT_TYPE_NODE ; } 466 bool isDocumentTypeNode() const { return getNodeType() == kDocumentTypeNode; }
468 virtual bool childTypeAllowed(NodeType) const { return false; } 467 virtual bool childTypeAllowed(NodeType) const { return false; }
469 unsigned countChildren() const; 468 unsigned countChildren() const;
470 469
471 bool isDescendantOf(const Node*) const; 470 bool isDescendantOf(const Node*) const;
472 bool contains(const Node*) const; 471 bool contains(const Node*) const;
473 bool isShadowIncludingInclusiveAncestorOf(const Node*) const; 472 bool isShadowIncludingInclusiveAncestorOf(const Node*) const;
474 bool containsIncludingHostElements(const Node&) const; 473 bool containsIncludingHostElements(const Node&) const;
475 Node* commonAncestor(const Node&, ContainerNode* (*parent)(const Node&)) con st; 474 Node* commonAncestor(const Node&, ContainerNode* (*parent)(const Node&)) con st;
476 475
477 // Used to determine whether range offsets use characters or node indices. 476 // Used to determine whether range offsets use characters or node indices.
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 } // namespace blink 881 } // namespace blink
883 882
884 #ifndef NDEBUG 883 #ifndef NDEBUG
885 // Outside the WebCore namespace for ease of invocation from gdb. 884 // Outside the WebCore namespace for ease of invocation from gdb.
886 void showNode(const blink::Node*); 885 void showNode(const blink::Node*);
887 void showTree(const blink::Node*); 886 void showTree(const blink::Node*);
888 void showNodePath(const blink::Node*); 887 void showNodePath(const blink::Node*);
889 #endif 888 #endif
890 889
891 #endif // Node_h 890 #endif // Node_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698