| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 virtual ~Node(); | 143 virtual ~Node(); |
| 144 | 144 |
| 145 // DOM methods & attributes for Node | 145 // DOM methods & attributes for Node |
| 146 | 146 |
| 147 bool hasTagName(const HTMLQualifiedName&) const; | 147 bool hasTagName(const HTMLQualifiedName&) const; |
| 148 virtual String nodeName() const = 0; | 148 virtual String nodeName() const = 0; |
| 149 virtual NodeType nodeType() const = 0; | 149 virtual NodeType nodeType() const = 0; |
| 150 ContainerNode* parentNode() const; | 150 ContainerNode* parentNode() const; |
| 151 Element* parentElement() const; | 151 Element* parentElement() const; |
| 152 ContainerNode* parentElementOrShadowRoot() const; | |
| 153 ContainerNode* parentElementOrDocumentFragment() const; | |
| 154 Node* previousSibling() const { return m_previous; } | 152 Node* previousSibling() const { return m_previous; } |
| 155 Node* nextSibling() const { return m_next; } | 153 Node* nextSibling() const { return m_next; } |
| 156 Node* firstChild() const; | 154 Node* firstChild() const; |
| 157 Node* lastChild() const; | 155 Node* lastChild() const; |
| 158 | 156 |
| 159 void remove(ExceptionState&); | 157 void remove(ExceptionState&); |
| 160 | 158 |
| 161 // These should all actually return a node, but this is only important for l
anguage bindings, | 159 // These should all actually return a node, but this is only important for l
anguage bindings, |
| 162 // which will already know and hold a ref on the right node to return. | 160 // which will already know and hold a ref on the right node to return. |
| 163 PassRefPtr<Node> insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exc
eptionState& = ASSERT_NO_EXCEPTION); | 161 PassRefPtr<Node> insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exc
eptionState& = ASSERT_NO_EXCEPTION); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 725 |
| 728 detach(context); | 726 detach(context); |
| 729 markAncestorsWithChildNeedsStyleRecalc(); | 727 markAncestorsWithChildNeedsStyleRecalc(); |
| 730 } | 728 } |
| 731 | 729 |
| 732 inline bool Node::shouldCallRecalcStyle(StyleRecalcChange change) | 730 inline bool Node::shouldCallRecalcStyle(StyleRecalcChange change) |
| 733 { | 731 { |
| 734 return change >= Inherit || needsStyleRecalc() || childNeedsStyleRecalc(); | 732 return change >= Inherit || needsStyleRecalc() || childNeedsStyleRecalc(); |
| 735 } | 733 } |
| 736 | 734 |
| 737 inline bool isTreeScopeRoot(const Node* node) | |
| 738 { | |
| 739 return !node || node->isDocumentNode() || node->isShadowRoot(); | |
| 740 } | |
| 741 | |
| 742 inline bool isTreeScopeRoot(const Node& node) | |
| 743 { | |
| 744 return node.isDocumentNode() || node.isShadowRoot(); | |
| 745 } | |
| 746 | |
| 747 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. | 735 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. |
| 748 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) | 736 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) |
| 749 | 737 |
| 750 | 738 |
| 751 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ | 739 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ |
| 752 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ | 740 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ |
| 753 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) | 741 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) |
| 754 | 742 |
| 755 // This requires isClassName(const Node&). | 743 // This requires isClassName(const Node&). |
| 756 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 744 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 768 } // namespace blink | 756 } // namespace blink |
| 769 | 757 |
| 770 #ifndef NDEBUG | 758 #ifndef NDEBUG |
| 771 // Outside the WebCore namespace for ease of invocation from gdb. | 759 // Outside the WebCore namespace for ease of invocation from gdb. |
| 772 void showNode(const blink::Node*); | 760 void showNode(const blink::Node*); |
| 773 void showTree(const blink::Node*); | 761 void showTree(const blink::Node*); |
| 774 void showNodePath(const blink::Node*); | 762 void showNodePath(const blink::Node*); |
| 775 #endif | 763 #endif |
| 776 | 764 |
| 777 #endif // Node_h | 765 #endif // Node_h |
| OLD | NEW |