Lines Matching full:node
80 class Node : public EventTarget, public TreeShared<Node>, public ScriptWrappable {
109 virtual ~Node();
111 // DOM methods & attributes for Node
118 Node* parentNode() const { return parent(); }
120 Node* previousSibling() const { return m_previous; }
121 Node* nextSibling() const { return m_next; }
123 Node* firstChild() const { return isContainerNode() ? containerFirstChild() : 0; }
124 Node* lastChild() const { return isContainerNode() ? containerLastChild() : 0; }
132 // These should all actually return a node, but this is only important for language bindings,
133 // which will already know and hold a ref on the right node to return. Returning bool allows
135 virtual bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&, bool shouldLazyAttach = false);
136 virtual bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode&, bool shouldLazyAttach = false);
137 virtual bool removeChild(Node* child, ExceptionCode&);
138 virtual bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&, bool shouldLazyAttach = false);
142 virtual PassRefPtr<Node> cloneNode(bool deep) = 0;
149 bool isSameNode(Node* other) const { return this == other; }
150 bool isEqualNode(Node*) const;
159 Node* lastDescendant() const;
160 Node* firstDescendant() const;
197 virtual Node* shadowParentNode() { return 0; }
198 Node* shadowAncestorNode();
199 Node* shadowTreeRootNode();
202 // The node's parent for the purpose of event capture and bubbling.
205 // Returns the enclosing event parent node (or self) that, when clicked, would trigger a navigation.
206 Node* enclosingLinkEventParentOrSelf();
208 // Node ancestors when concerned about event flow
215 void setPreviousSibling(Node* previous) { m_previous = previous; }
216 void setNextSibling(Node* next) { m_next = next; }
218 // FIXME: These two functions belong in editing -- "atomic node" is an editing concept.
219 Node* previousNodeConsideringAtomicNodes() const;
220 Node* nextNodeConsideringAtomicNodes() const;
223 * Returns the next leaf node.
226 * @return next leaf node or 0 if there are no more.
228 Node* nextLeafNode() const;
231 * Returns the previous leaf node.
234 * @return previous leaf node or 0 if there are no more.
236 Node* previousLeafNode() const;
246 bool inSameContainingBlockFlowElement(Node*);
250 // Returns the appropriate container node for future insertions as you parse, or 0 for failure.
251 virtual ContainerNode* addChild(PassRefPtr<Node>);
300 // Whether this kind of node can receive focus by default. Most nodes are
303 // Whether the node can actually be focused.
318 // of (1) a Document node or (2) a DocumentType node that is not used with any Document yet.
321 // Returns the document associated with this node. This method never returns NULL, except in the case
322 // of a DocumentType node that is not used with any Document yet. A Document node returns itself.
331 // Returns true if this node is associated with a document and is in its associated document's
332 // node tree, false otherwise.
342 Node* childNode(unsigned index) const { return isContainerNode() ? containerChildNode(index) : 0; }
345 * Does a pre-order traversal of the tree to find the node next node after this one. This uses the same order that
348 * @param stayWithin If not null, the traversal will stop once the specified node is reached. This can be used to
351 * @return The next node, in document order
355 Node* traverseNextNode(const Node* stayWithin = 0) const;
358 Node* traverseNextSibling(const Node* stayWithin = 0) const;
361 * Does a reverse pre-order traversal to find the node that comes before the current one in document order
365 Node* traversePreviousNode(const Node * stayWithin = 0) const;
368 Node* traverseNextNodePostOrder() const;
371 Node* traversePreviousNodePostOrder(const Node *stayWithin = 0) const;
372 Node* traversePreviousSiblingPostOrder(const Node *stayWithin = 0) const;
375 * Finds previous or next editable leaf node.
377 Node* previousEditable() const;
378 Node* nextEditable() const;
390 bool isDescendantOf(const Node*) const;
391 bool contains(const Node*) const;
396 void checkAddChild(Node* newChild, ExceptionCode&); // Error-checking when adding via the DOM API
397 virtual bool childAllowed(Node* newChild); // Error-checking during parsing that checks the DTD
399 void checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode&);
400 Node* newChild, Node* oldChild);
402 // Used to determine whether range offsets use characters or node indices.
404 // Number of DOM 16-bit units contained in node. Note that rendered text length can be different - e.g. because of
423 * Attaches this node to the rendering tree. This calculates the style to be applied to the node and creates an
425 * makes the node visible in the FrameView.
430 * Detaches the node from the rendering tree, making it invisible in the rendered view. This method will remove
431 * the node's rendering object from the rendering tree and delete it.
440 virtual bool childShouldCreateRenderer(Node*) const { return true; }
454 * Notifies the node that it has been inserted into the document. This is called during document parsing, and also
455 * when a node is added through the DOM methods insertBefore(), appendChild() or replaceChild(). Note that this only
456 * happens when the node becomes part of the document tree, i.e. only when the document is actually an ancestor of
457 * the node. The call happens _after_ the node has been added to the tree.
465 * Notifies the node that it is no longer part of the document tree, i.e. when the document is no longer an ancestor
466 * node.
469 * dispatching, and is called _after_ the node is removed from the tree.
480 * Notifies the node that it's list of children have changed (either by adding or removing child nodes), or a child
481 * node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE has changed its value.
483 virtual void childrenChanged(bool /*changedByParser*/ = false, Node* /*beforeChange*/ = 0, Node* /*afterChange*/ = 0, int /*childCountDelta*/ = 0) { }
490 void showTreeAndMark(const Node* markedNode1, const char* markedLabel1, const Node* markedNode2 = 0, const char* markedLabel2 = 0) const;
508 unsigned short compareDocumentPosition(Node*);
522 virtual Node* toNode() { return this; }
529 // Handlers to do/undo actions on the target node before an event is dispatched to it and after the event
545 int clickCount = 0, Node* relatedTarget = 0);
549 bool isSimulated, Node* relatedTarget, PassRefPtr<Event> underlyingEvent);
567 using TreeShared<Node>::ref;
568 using TreeShared<Node>::deref;
577 Node(Document*, ConstructionType);
605 Node* containerChildNode(unsigned index) const;
607 Node* containerFirstChild() const;
608 Node* containerLastChild() const;
622 Node* m_previous;
623 Node* m_next;
644 // be stored in the same memory word as the Node bits above.
659 // Used in Node::addSubresourceAttributeURLs() and in addSubresourceStyleURLs()
670 void showTree(const WebCore::Node*);