Home | History | Annotate | Download | only in dom

Lines Matching defs:node

304 static Widget* widgetForNode(Node* focusedNode)
314 static bool acceptsEditingFocus(Node *node)
316 ASSERT(node);
317 ASSERT(node->isContentEditable());
319 Node *root = node->rootEditableElement();
320 Frame* frame = node->document()->frame();
624 void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
635 Node* n = firstChild();
714 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionCode& ec)
759 for (Node* oldChild = oldElement->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {
760 RefPtr<Node> newChild = importNode(oldChild, true, ec);
777 for (Node* oldChild = oldFragment->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {
778 RefPtr<Node> newChild = importNode(oldChild, true, ec);
791 // FIXME: It should be possible to import these node types, however in DOM3 the DocumentType is readonly, so there isn't much sense in doing that.
804 PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
839 for (Node* node = source.get(); node; node = node->traverseNextNode(source.get()))
840 node->setDocument(this);
925 // We know there's at least one node with this id, but we don't know what the first one is.
926 for (Node *n = traverseNextNode(); n != 0; n = n->traverseNextNode()) {
1031 Node* n = result.innerNode();
1061 Node* node = result.innerNode();
1062 if (!node)
1065 Node* shadowAncestorNode = node->shadowAncestorNode();
1066 if (shadowAncestorNode != node) {
1068 Node* container = shadowAncestorNode->parentNode();
1072 RenderObject* renderer = node->renderer();
1126 for (Node* n = firstChild(); n; n = n->traverseNextNode()) {
1246 for (Node* e = headElement->firstChild(); e; e = e->nextSibling())
1265 Node::NodeType Document::nodeType() const
1290 PassRefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow,
1300 PassRefPtr<TreeWalker> Document::createTreeWalker(Node *root, unsigned whatToShow,
1390 for (Node* n = firstChild(); n; n = n->nextSibling())
1580 // us. However, this violates Node::detach() semantics, as it's never
1603 for (Node* node = firstChild(); node; node = node->traverseNextNode())
1604 node->removeAllEventListeners();
1744 Node* de = documentElement();
1749 Node* body = 0;
1750 for (Node* i = de->firstChild(); i; i = i->nextSibling()) {
1776 Node* de = documentElement();
1780 for (Node* e = de->firstChild(); e; e = e->nextSibling())
1830 if (Node* documentElement = this->documentElement()) {
2144 static Node* nextNodeWithExactTabIndex(Node* start, int tabIndex, KeyboardEvent* event)
2147 for (Node* n = start; n; n = n->traverseNextNode())
2154 static Node* previousNodeWithExactTabIndex(Node* start, int tabIndex, KeyboardEvent* event)
2157 for (Node* n = start; n; n = n->traversePreviousNode())
2164 static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex, KeyboardEvent* event)
2168 Node* winner = 0;
2169 for (Node* n = start; n; n = n->traverseNextNode())
2178 static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex, KeyboardEvent* event)
2182 Node* winner = 0;
2183 for (Node* n = start; n; n = n->traversePreviousNode())
2192 Node* Document::nextFocusableNode(Node* start, KeyboardEvent* event)
2195 // If a node is excluded from the normal tabbing cycle, the next focusable node is determined by tree order
2197 for (Node* n = start->traverseNextNode(); n; n = n->traverseNextNode())
2202 // First try to find a node with the same tabindex as start that comes after start in the document.
2203 if (Node* winner = nextNodeWithExactTabIndex(start->traverseNextNode(), start->tabIndex(), event))
2207 // We've reached the last node in the document with a tabindex of 0. This is the end of the tabbing order.
2211 // Look for the first node in the document that:
2214 if (Node* winner = nextNodeWithGreaterTabIndex(this, start ? start->tabIndex() : 0, event))
2218 // so find the first node with a tabindex of 0.
2222 Node* Document::previousFocusableNode(Node* start, KeyboardEvent* event)
2224 Node* last;
2228 // First try to find the last node in the document that comes before start and has the same tabindex as start.
2229 // If start is null, find the last node in the document with a tabindex of 0.
2230 Node* startingNode;
2240 // However, if a node is excluded from the normal tabbing cycle, the previous focusable node is determined by tree order
2242 for (Node* n = startingNode; n; n = n->traversePreviousNode())
2247 if (Node* winner = previousNodeWithExactTabIndex(startingNode, startingTabIndex, event))
2250 // There are no nodes before start with the same tabindex as start, so look for a node that:
2257 int Document::nodeAbsIndex(Node *node)
2259 ASSERT(node->document() == this);
2262 for (Node *n = node; n && n != this; n = n->traversePreviousNode())
2267 Node *Document::nodeWithAbsIndex(int absIndex)
2269 Node *n = this;
2417 for (Node* c = firstChild(); c; c = c->nextSibling())
2425 bool Document::canReplaceChild(Node* newChild, Node* oldChild)
2439 for (Node* c = firstChild(); c; c = c->nextSibling()) {
2457 for (Node* c = firstChild(); c; c = c->nextSibling()) {
2510 PassRefPtr<Node> Document::cloneNode(bool /*deep*/)
2595 void Document::addStyleSheetCandidateNode(Node* node, bool createdByParser)
2602 m_styleSheetCandidateNodes.add(node);
2607 ListHashSet<Node*>::iterator begin = m_styleSheetCandidateNodes.begin();
2608 ListHashSet<Node*>::iterator end = m_styleSheetCandidateNodes.end();
2609 ListHashSet<Node*>::iterator it = end;
2610 Node* followingNode = 0;
2613 Node* n = *it;
2614 unsigned short position = n->compareDocumentPosition(node);
2616 node);
2622 m_styleSheetCandidateNodes.insertBefore(followingNode, node);
2625 void Document::removeStyleSheetCandidateNode(Node* node)
2627 m_styleSheetCandidateNodes.remove(node);
2641 ListHashSet<Node*>::iterator begin = m_styleSheetCandidateNodes.begin();
2642 ListHashSet<Node*>::iterator end = m_styleSheetCandidateNodes.end();
2645 for (ListHashSet<Node*>::iterator it = begin; it != end; ++it) {
2646 Node* n = *it;
2671 for (Node* c = elem->firstChild(); c; c = c->nextSibling()) {
2754 void Document::setHoverNode(PassRefPtr<Node> newHoverNode)
2759 void Document::setActiveNode(PassRefPtr<Node> newActiveNode)
2769 void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
2771 if (!m_focusedNode || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node.
2776 nodeInSubtree = m_focusedNode->isDescendantOf(node);
2778 nodeInSubtree = (m_focusedNode == node) || m_focusedNode->isDescendantOf(node);
2784 void Document::hoveredNodeDetached(Node* node)
2786 if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || node != m_hoverNode->parent())))
2789 m_hoverNode = node->parent();
2796 void Document::activeChainNodeDetached(Node* node)
2798 if (!m_activeNode || (node != m_activeNode && (!m_activeNode->isTextNode() || node != m_activeNode->parent())))
2801 m_activeNode = node->parent();
2819 bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
2832 RefPtr<Node> oldFocusedNode = m_focusedNode;
2835 // Remove focus from the existing focus node (if any)
2851 // Dispatch the blur event and let the node do any other blur related activities (important for text fields)
2878 // Set focus on the new node
2881 // Dispatch the focus event and let the node do any other focus related activities (important for text fields)
2940 void Document::getFocusableNodes(Vector<RefPtr<Node> >& nodes)
2944 for (Node* node = firstChild(); node; node = node->traverseNextNode()) {
2945 if (node->isFocusable())
2946 nodes.append(node);
2978 void Document::nodeWillBeRemoved(Node* n)
2996 void Document::textInserted(Node* text, unsigned offset, unsigned length)
3008 void Document::textRemoved(Node* text, unsigned offset, unsigned length)
3637 Node* startContainer = range->startContainer(ec);
3638 Node* endContainer = range->endContainer(ec);
3640 Node* pastLastNode = range->pastLastNode();
3641 for (Node* node = range->firstNode(); node != pastLastNode; node = node->traverseNextNode()) {
3642 int startOffset = node == startContainer ? range->startOffset(ec) : 0;
3643 int endOffset = node == endContainer ? range->endOffset(ec) : INT_MAX;
3645 removeMarkers(node, startOffset, length, markerType);
3652 void Document::addMarker(Node* node, DocumentMarker newMarker)
3658 MarkerMapVectorPair* vectorPair = m_markers.get(node);
3664 m_markers.set(node, vectorPair);
3705 // At this point i points to the node before which we want to insert.
3710 // repaint the affected node
3711 if (node->renderer())
3712 node->renderer()->repaint();
3717 void Document::copyMarkers(Node *srcNode, unsigned startOffset, int length, Node *dstNode, int delta, DocumentMarker::MarkerType markerType)
3754 // repaint the affected node
3759 void Document::removeMarkers(Node* node, unsigned startOffset, int length, DocumentMarker::MarkerType markerType)
3764 MarkerMapVectorPair* vectorPair = m_markers.get(node);
3799 // i now points to the newly-inserted node, but we want to skip that one
3807 // i now points to the newly-inserted node, but we want to skip that one
3814 m_markers.remove(node);
3818 // repaint the affected node
3819 if (docDirty && node->renderer())
3820 node->renderer()->repaint();
3825 // outer loop: process each node that contains any markers
3828 // inner loop; process each marker in this node
3855 Vector<DocumentMarker> Document::markersForNode(Node* node)
3857 MarkerMapVectorPair* vectorPair = m_markers.get(node);
3867 // outer loop: process each node
3870 // inner loop; process each marker in this node
3895 void Document::removeMarkers(Node* node)
3897 MarkerMap::iterator i = m_markers.find(node);
3901 if (RenderObject* renderer = node->renderer())
3908 // outer loop: process each markered node in the document
3912 Node* node = i->first.get();
3915 // inner loop: process each marker in the current node
3933 // markerIterator now points to the next node
3936 // Redraw the node if it changed. Do this before the node is removed from m_markers, since
3937 // m_markers might contain the last reference to the node.
3939 RenderObject* renderer = node->renderer();
3944 // delete the node's list if it is now empty
3947 m_markers.remove(node);
3955 // outer loop: process each markered node in the document
3958 Node* node = i->first.get();
3960 // inner loop: process each marker in the current node
3977 // cause the node to be redrawn
3978 if (RenderObject* renderer = node->renderer())
3983 void Document::setRenderedRectForMarker(Node* node, const DocumentMarker& marker, const IntRect& r)
3985 MarkerMapVectorPair* vectorPair = m_markers.get(node);
4007 // outer loop: process each markered node in the document
4011 // inner loop: process each rect in the current node
4022 void Document::shiftMarkers(Node *node, unsigned startOffset, int delta, DocumentMarker::MarkerType markerType)
4024 MarkerMapVectorPair* vectorPair = m_markers.get(node);
4046 // repaint the affected node
4047 if (docDirty && node->renderer())
4048 node->renderer()->repaint();
4057 Node* startContainer = range->startContainer(ec);
4058 Node* endContainer = range->endContainer(ec);
4060 Node* pastLastNode = range->pastLastNode();
4061 for (Node* node = range->firstNode(); node != pastLastNode; nodenode->traverseNextNode()) {
4062 int startOffset = node == startContainer ? range->startOffset(ec) : 0;
4063 int endOffset = node == endContainer ? range->endOffset(ec) : INT_MAX;
4064 setMarkersActive(node, startOffset, endOffset, active);
4068 void Document::setMarkersActive(Node* node, unsigned startOffset, unsigned endOffset, bool active)
4070 MarkerMapVectorPair* vectorPair = m_markers.get(node);
4093 // repaint the affected node
4094 if (docDirty && node->renderer())
4095 node->renderer()->repaint();
4325 PassRefPtr<XPathNSResolver> Document::createNSResolver(Node* nodeResolver)
4333 Node* contextNode,
4615 Node* node = focusedNode();
4616 if (!node)
4618 if (!node->isElementNode())
4623 Element* element = static_cast<Element*>(node);
4839 for (Node* node = this; node; node = node->traverseNextNode()) {
4840 if (node->hasTagName(aTag)) {
4841 HTMLAnchorElement* anchor = static_cast<HTMLAnchorElement*>(node);