| 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 Node* pseudoAwareNextSibling() const; | 181 Node* pseudoAwareNextSibling() const; |
| 182 Node* pseudoAwarePreviousSibling() const; | 182 Node* pseudoAwarePreviousSibling() const; |
| 183 Node* pseudoAwareFirstChild() const; | 183 Node* pseudoAwareFirstChild() const; |
| 184 Node* pseudoAwareLastChild() const; | 184 Node* pseudoAwareLastChild() const; |
| 185 | 185 |
| 186 virtual KURL baseURI() const; | 186 virtual KURL baseURI() const; |
| 187 | 187 |
| 188 // These should all actually return a node, but this is only important for l
anguage bindings, | 188 // These should all actually return a node, but this is only important for l
anguage bindings, |
| 189 // which will already know and hold a ref on the right node to return. | 189 // which will already know and hold a ref on the right node to return. |
| 190 void insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionState&
= ASSERT_NO_EXCEPTION); | 190 void insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, Exc
eptionState& = ASSERT_NO_EXCEPTION); |
| 191 void replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionState&
= ASSERT_NO_EXCEPTION); | 191 void replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, Exc
eptionState& = ASSERT_NO_EXCEPTION); |
| 192 void removeChild(Node* child, ExceptionState&); | 192 void removeChild(Node* child, ExceptionState&); |
| 193 void appendChild(PassRefPtr<Node> newChild, ExceptionState& = ASSERT_NO_EXCE
PTION); | 193 void appendChild(PassRefPtrWillBeRawPtr<Node> newChild, ExceptionState& = AS
SERT_NO_EXCEPTION); |
| 194 | 194 |
| 195 bool hasChildren() const { return firstChild(); } | 195 bool hasChildren() const { return firstChild(); } |
| 196 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = false) = 0; | 196 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = false) = 0; |
| 197 virtual const AtomicString& localName() const; | 197 virtual const AtomicString& localName() const; |
| 198 virtual const AtomicString& namespaceURI() const; | 198 virtual const AtomicString& namespaceURI() const; |
| 199 void normalize(); | 199 void normalize(); |
| 200 | 200 |
| 201 bool isSameNode(Node* other) const { return this == other; } | 201 bool isSameNode(Node* other) const { return this == other; } |
| 202 bool isEqualNode(Node*) const; | 202 bool isEqualNode(Node*) const; |
| 203 bool isDefaultNamespace(const AtomicString& namespaceURI) const; | 203 bool isDefaultNamespace(const AtomicString& namespaceURI) const; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 return !node || node->isDocumentNode() || node->isShadowRoot(); | 878 return !node || node->isDocumentNode() || node->isShadowRoot(); |
| 879 } | 879 } |
| 880 | 880 |
| 881 inline bool isTreeScopeRoot(const Node& node) | 881 inline bool isTreeScopeRoot(const Node& node) |
| 882 { | 882 { |
| 883 return node.isDocumentNode() || node.isShadowRoot(); | 883 return node.isDocumentNode() || node.isShadowRoot(); |
| 884 } | 884 } |
| 885 | 885 |
| 886 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. | 886 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. |
| 887 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) | 887 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) |
| 888 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_RAWPTR(Node) |
| 888 | 889 |
| 889 | 890 |
| 890 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ | 891 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ |
| 891 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ | 892 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ |
| 892 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) | 893 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) |
| 893 | 894 |
| 894 // This requires isClassName(const Node&). | 895 // This requires isClassName(const Node&). |
| 895 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 896 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 896 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ | 897 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ |
| 897 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no
de)) | 898 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no
de)) |
| 898 | 899 |
| 899 #define DEFINE_NODE_FACTORY(T) \ | 900 #define DEFINE_NODE_FACTORY(T) \ |
| 900 inline static PassRefPtrWillBeRawPtr<T> create(Document& document) \ | 901 inline static PassRefPtrWillBeRawPtr<T> create(Document& document) \ |
| 901 { \ | 902 { \ |
| 902 return adoptRefWillBeRefCountedGarbageCollected(new T(document)); \ | 903 return adoptRefWillBeRefCountedGarbageCollected(new T(document)); \ |
| 903 } | 904 } |
| 904 | 905 |
| 905 } // namespace WebCore | 906 } // namespace WebCore |
| 906 | 907 |
| 907 #ifndef NDEBUG | 908 #ifndef NDEBUG |
| 908 // Outside the WebCore namespace for ease of invocation from gdb. | 909 // Outside the WebCore namespace for ease of invocation from gdb. |
| 909 void showNode(const WebCore::Node*); | 910 void showNode(const WebCore::Node*); |
| 910 void showTree(const WebCore::Node*); | 911 void showTree(const WebCore::Node*); |
| 911 void showNodePath(const WebCore::Node*); | 912 void showNodePath(const WebCore::Node*); |
| 912 #endif | 913 #endif |
| 913 | 914 |
| 914 #endif | 915 #endif |
| OLD | NEW |