Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 WILL_NOT_BE_EAGERLY_TRACED_CLASS(Node); | 128 WILL_NOT_BE_EAGERLY_TRACED_CLASS(Node); |
| 129 | 129 |
| 130 // This class represents a DOM node in the DOM tree. | 130 // This class represents a DOM node in the DOM tree. |
| 131 // https://dom.spec.whatwg.org/#interface-node | 131 // https://dom.spec.whatwg.org/#interface-node |
| 132 class CORE_EXPORT Node : public EventTarget { | 132 class CORE_EXPORT Node : public EventTarget { |
| 133 DEFINE_WRAPPERTYPEINFO(); | 133 DEFINE_WRAPPERTYPEINFO(); |
| 134 friend class TreeScope; | 134 friend class TreeScope; |
| 135 friend class TreeScopeAdopter; | 135 friend class TreeScopeAdopter; |
| 136 public: | 136 public: |
| 137 enum NodeType { | 137 enum NodeType { |
| 138 ELEMENT_NODE = 1, | 138 kElementNode = 1, |
| 139 ATTRIBUTE_NODE = 2, | 139 kAttributeNode = 2, |
| 140 TEXT_NODE = 3, | 140 kTextNode = 3, |
| 141 CDATA_SECTION_NODE = 4, | 141 kCdataSectionNode = 4, |
| 142 PROCESSING_INSTRUCTION_NODE = 7, | 142 kProcessingInstructionNode = 7, |
| 143 COMMENT_NODE = 8, | 143 kCommentNode = 8, |
| 144 DOCUMENT_NODE = 9, | 144 kDocumentNode = 9, |
| 145 DOCUMENT_TYPE_NODE = 10, | 145 kDocumentTypeNode = 10, |
| 146 DOCUMENT_FRAGMENT_NODE = 11, | 146 kDocumentFragmentNode = 11, |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 // Entity, EntityReference, Notation, and XPathNamespace nodes are impossibl e to create in Blink. | 149 // Entity, EntityReference, Notation, and XPathNamespace nodes are impossibl e to create in Blink. |
| 150 // But for compatibility reasons we want these enum values exist in JS, and this enum makes the bindings | 150 // But for compatibility reasons we want these enum values exist in JS, and this enum makes the bindings |
| 151 // generation not complain about ENTITY_REFERENCE_NODE being missing from th e implementation | 151 // generation not complain about kEntityReferenceNode being missing from the implementation |
| 152 // while not requiring all switch(NodeType) blocks to include this deprecate d constant. | 152 // while not requiring all switch(NodeType) blocks to include this deprecate d constant. |
| 153 enum DeprecatedNodeType { | 153 enum DeprecatedNodeType { |
| 154 ENTITY_REFERENCE_NODE = 5, | 154 kEntityReferenceNode = 5, |
| 155 ENTITY_NODE = 6, | 155 kEntityNode = 6, |
| 156 NOTATION_NODE = 12, | 156 kNotationNode = 12, |
| 157 XPATH_NAMESPACE_NODE = 13, | 157 XPATH_NAMESPACE_NODE = 13, |
|
tkent
2016/07/27 03:23:47
Can we remove XPATH_NAMESPACE_NODE?
iclelland
2016/07/27 14:07:06
I think so -- I don't see any reason at all to kee
| |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 enum DocumentPosition { | 160 enum DocumentPosition { |
| 161 DOCUMENT_POSITION_EQUIVALENT = 0x00, | 161 DOCUMENT_POSITION_EQUIVALENT = 0x00, |
|
tkent
2016/07/27 03:23:47
Rename this to kDocumentPositionEquivalent for con
iclelland
2016/07/27 14:07:06
Done.
| |
| 162 DOCUMENT_POSITION_DISCONNECTED = 0x01, | 162 kDocumentPositionDisconnected = 0x01, |
| 163 DOCUMENT_POSITION_PRECEDING = 0x02, | 163 kDocumentPositionPreceding = 0x02, |
| 164 DOCUMENT_POSITION_FOLLOWING = 0x04, | 164 kDocumentPositionFollowing = 0x04, |
| 165 DOCUMENT_POSITION_CONTAINS = 0x08, | 165 kDocumentPositionContains = 0x08, |
| 166 DOCUMENT_POSITION_CONTAINED_BY = 0x10, | 166 kDocumentPositionContainedBy = 0x10, |
| 167 DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20, | 167 kDocumentPositionImplementationSpecific = 0x20, |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 // Override operator new to allocate Node subtype objects onto | 170 // Override operator new to allocate Node subtype objects onto |
| 171 // a dedicated heap. | 171 // a dedicated heap. |
| 172 GC_PLUGIN_IGNORE("crbug.com/443854") | 172 GC_PLUGIN_IGNORE("crbug.com/443854") |
| 173 void* operator new(size_t size) | 173 void* operator new(size_t size) |
| 174 { | 174 { |
| 175 return allocateObject(size, false); | 175 return allocateObject(size, false); |
| 176 } | 176 } |
| 177 static void* allocateObject(size_t size, bool isEager) | 177 static void* allocateObject(size_t size, bool isEager) |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); } | 455 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); } |
| 456 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(IsConnect edFlag | IsInShadowTreeFlag)); } | 456 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(IsConnect edFlag | IsInShadowTreeFlag)); } |
| 457 | 457 |
| 458 ElementShadow* parentElementShadow() const; | 458 ElementShadow* parentElementShadow() const; |
| 459 bool isInV1ShadowTree() const; | 459 bool isInV1ShadowTree() const; |
| 460 bool isInV0ShadowTree() const; | 460 bool isInV0ShadowTree() const; |
| 461 bool isChildOfV1ShadowHost() const; | 461 bool isChildOfV1ShadowHost() const; |
| 462 bool isChildOfV0ShadowHost() const; | 462 bool isChildOfV0ShadowHost() const; |
| 463 ShadowRoot* v1ShadowRootOfParent() const; | 463 ShadowRoot* v1ShadowRootOfParent() const; |
| 464 | 464 |
| 465 bool isDocumentTypeNode() const { return getNodeType() == DOCUMENT_TYPE_NODE ; } | 465 bool isDocumentTypeNode() const { return getNodeType() == kDocumentTypeNode; } |
| 466 virtual bool childTypeAllowed(NodeType) const { return false; } | 466 virtual bool childTypeAllowed(NodeType) const { return false; } |
| 467 unsigned countChildren() const; | 467 unsigned countChildren() const; |
| 468 | 468 |
| 469 bool isDescendantOf(const Node*) const; | 469 bool isDescendantOf(const Node*) const; |
| 470 bool contains(const Node*) const; | 470 bool contains(const Node*) const; |
| 471 bool isShadowIncludingInclusiveAncestorOf(const Node*) const; | 471 bool isShadowIncludingInclusiveAncestorOf(const Node*) const; |
| 472 bool containsIncludingHostElements(const Node&) const; | 472 bool containsIncludingHostElements(const Node&) const; |
| 473 Node* commonAncestor(const Node&, ContainerNode* (*parent)(const Node&)) con st; | 473 Node* commonAncestor(const Node&, ContainerNode* (*parent)(const Node&)) con st; |
| 474 | 474 |
| 475 // Used to determine whether range offsets use characters or node indices. | 475 // Used to determine whether range offsets use characters or node indices. |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 892 } // namespace blink | 892 } // namespace blink |
| 893 | 893 |
| 894 #ifndef NDEBUG | 894 #ifndef NDEBUG |
| 895 // Outside the WebCore namespace for ease of invocation from gdb. | 895 // Outside the WebCore namespace for ease of invocation from gdb. |
| 896 void showNode(const blink::Node*); | 896 void showNode(const blink::Node*); |
| 897 void showTree(const blink::Node*); | 897 void showTree(const blink::Node*); |
| 898 void showNodePath(const blink::Node*); | 898 void showNodePath(const blink::Node*); |
| 899 #endif | 899 #endif |
| 900 | 900 |
| 901 #endif // Node_h | 901 #endif // Node_h |
| OLD | NEW |