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 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #ifndef ContainerNode_h | 24 #ifndef ContainerNode_h |
25 #define ContainerNode_h | 25 #define ContainerNode_h |
26 | 26 |
27 #include "Node.h" | 27 #include "EventTargetNode.h" |
28 #include "FloatPoint.h" | 28 #include "FloatPoint.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 typedef void (*NodeCallback)(Node*); | 32 typedef void (*NodeCallback)(Node*); |
33 | 33 |
34 namespace Private { | 34 namespace Private { |
35 template<class GenericNode, class GenericNodeContainer> | 35 template<class GenericNode, class GenericNodeContainer> |
36 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Ge
nericNodeContainer* container); | 36 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Ge
nericNodeContainer* container); |
37 }; | 37 }; |
38 | 38 |
39 class ContainerNode : public Node { | 39 class ContainerNode : public EventTargetNode { |
40 public: | 40 public: |
41 ContainerNode(Document*, bool isElement = false); | 41 ContainerNode(Document*, bool isElement = false); |
42 virtual ~ContainerNode(); | 42 virtual ~ContainerNode(); |
43 | 43 |
44 Node* firstChild() const { return m_firstChild; } | 44 Node* firstChild() const { return m_firstChild; } |
45 Node* lastChild() const { return m_lastChild; } | 45 Node* lastChild() const { return m_lastChild; } |
46 | 46 |
47 virtual bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, Excepti
onCode&, bool shouldLazyAttach = false); | 47 virtual bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, Excepti
onCode&, bool shouldLazyAttach = false); |
48 virtual bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Excepti
onCode&, bool shouldLazyAttach = false); | 48 virtual bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Excepti
onCode&, bool shouldLazyAttach = false); |
49 virtual bool removeChild(Node* child, ExceptionCode&); | 49 virtual bool removeChild(Node* child, ExceptionCode&); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 static void dispatchPostAttachCallbacks(); | 91 static void dispatchPostAttachCallbacks(); |
92 | 92 |
93 bool getUpperLeftCorner(FloatPoint&) const; | 93 bool getUpperLeftCorner(FloatPoint&) const; |
94 bool getLowerRightCorner(FloatPoint&) const; | 94 bool getLowerRightCorner(FloatPoint&) const; |
95 | 95 |
96 Node* m_firstChild; | 96 Node* m_firstChild; |
97 Node* m_lastChild; | 97 Node* m_lastChild; |
98 }; | 98 }; |
99 | 99 |
100 inline ContainerNode::ContainerNode(Document* document, bool isElement) | 100 inline ContainerNode::ContainerNode(Document* document, bool isElement) |
101 : Node(document, isElement, true) | 101 : EventTargetNode(document, isElement, true) |
102 , m_firstChild(0) | 102 , m_firstChild(0) |
103 , m_lastChild(0) | 103 , m_lastChild(0) |
104 { | 104 { |
105 } | 105 } |
106 | 106 |
107 inline unsigned Node::containerChildNodeCount() const | 107 inline unsigned Node::containerChildNodeCount() const |
108 { | 108 { |
109 ASSERT(isContainerNode()); | 109 ASSERT(isContainerNode()); |
110 return static_cast<const ContainerNode*>(this)->childNodeCount(); | 110 return static_cast<const ContainerNode*>(this)->childNodeCount(); |
111 } | 111 } |
(...skipping 12 matching lines...) Expand all Loading... |
124 | 124 |
125 inline Node* Node::containerLastChild() const | 125 inline Node* Node::containerLastChild() const |
126 { | 126 { |
127 ASSERT(isContainerNode()); | 127 ASSERT(isContainerNode()); |
128 return static_cast<const ContainerNode*>(this)->lastChild(); | 128 return static_cast<const ContainerNode*>(this)->lastChild(); |
129 } | 129 } |
130 | 130 |
131 } // namespace WebCore | 131 } // namespace WebCore |
132 | 132 |
133 #endif // ContainerNode_h | 133 #endif // ContainerNode_h |
OLD | NEW |