Lines Matching defs:node
26 #include "Node.h"
118 static HashSet<Node*>* gNodesDispatchingSimulatedClicks = 0;
120 bool Node::isSupported(const String& feature, const String& version)
126 static HashSet<Node*> liveNodeSet;
129 void Node::dumpStatistics()
157 for (HashSet<Node*>::iterator it = liveNodeSet.begin(); it != liveNodeSet.end(); ++it) {
158 Node* node = *it;
160 if (node->hasRareData())
163 switch (node->nodeType()) {
168 Element* element = static_cast<Element*>(node);
267 printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes, sizeof(Attribute));
280 static HashSet<Node*> ignoreSet;
283 void Node::startIgnoringLeaks()
290 void Node::stopIgnoringLeaks()
297 Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2)
347 inline bool Node::initialRefCount(ConstructionType type)
362 inline bool Node::isContainer(ConstructionType type)
377 inline bool Node::isElement(ConstructionType type)
392 inline bool Node::isText(ConstructionType type)
407 Node::Node(Document* document, ConstructionType type)
408 : TreeShared<Node>(initialRefCount(type))
452 Node::~Node()
455 HashSet<Node*>::iterator it = ignoreSet.find(this);
518 void Node::setDocument(Document* document)
549 NodeRareData* Node::rareData() const
555 NodeRareData* Node::ensureRareData()
567 NodeRareData* Node::createRareData()
572 short Node::tabIndex() const
577 void Node::setTabIndexExplicitly(short i)
582 String Node::nodeValue() const
587 void Node
589 // NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly
598 PassRefPtr<NodeList> Node::childNodes()
610 Node *Node::lastDescendant() const
612 Node *n = const_cast<Node *>(this);
618 Node* Node::firstDescendant() const
620 Node *n = const_cast<Node *>(this);
626 bool Node::insertBefore(PassRefPtr<Node>, Node*, ExceptionCode& ec, bool)
632 bool Node::replaceChild(PassRefPtr<Node>, Node*, ExceptionCode& ec, bool)
638 bool Node::removeChild(Node*, ExceptionCode& ec)
644 bool Node::appendChild(PassRefPtr<Node>, ExceptionCode& ec, bool)
650 void Node::remove(ExceptionCode& ec)
653 if (Node *p = parentNode())
660 void Node::normalize()
665 RefPtr<Node> node = this;
666 while (Node* firstChild = node->firstChild())
667 node = firstChild;
668 while (node) {
669 NodeType type = node->nodeType();
671 static_cast<Element*>(node.get())->normalizeAttributes();
673 if (node == this)
677 node = node->traverseNextNodePostOrder();
681 Text* text = static_cast<Text*>(node.get());
685 // Care must be taken to get the next node before removing the current node.
686 node = node->traverseNextNodePostOrder();
693 while (Node* nextSibling = node->nextSibling()) {
713 node = node->traverseNextNodePostOrder();
717 const AtomicString& Node::virtualPrefix() const
723 void Node::setPrefix(const AtomicString& /*prefix*/, ExceptionCode& ec)
727 // node, however Mozilla throws a NAMESPACE_ERR exception.
731 const AtomicString& Node::virtualLocalName() const
736 const AtomicString& Node::virtualNamespaceURI() const
741 ContainerNode* Node::addChild(PassRefPtr<Node>)
746 bool Node::isContentEditable() const
751 bool Node::isContentRichlyEditable() const
756 bool Node::shouldUseInputMethod() const
761 RenderBox* Node::renderBox() const
766 RenderBoxModelObject* Node::renderBoxModelObject() const
771 IntRect Node::getRect() const
779 void Node::setNeedsStyleRecalc(StyleChangeType changeType)
788 for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
795 static Node* outermostLazyAttachedAncestor(Node* start)
797 Node* p = start;
798 for (Node* next = p->parentNode(); !next->renderer(); p = next, next = next->parentNode()) {}
802 void Node::lazyAttach()
806 for (Node* n = this; n; n = n->traverseNextNode(this)) {
819 Node* lazyAttachedAncestor = outermostLazyAttachedAncestor(this);
824 for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
831 bool Node::canLazyAttach()
836 void Node::setFocus(bool b)
842 bool Node::rareDataFocused() const
848 bool Node::supportsFocus() const
853 bool Node::isFocusable() const
861 // If the node is in a display:none tree it might say it needs style recalc but
873 bool Node::isKeyboardFocusable(KeyboardEvent*) const
878 bool Node::isMouseFocusable() const
883 unsigned Node::nodeIndex() const
885 Node *_tempNode = previousSibling();
892 void Node::registerDynamicNodeList(DynamicNodeList* list)
907 void Node::unregisterDynamicNodeList(DynamicNodeList* list)
922 void Node::notifyLocalNodeListsAttributeChanged()
941 void Node::notifyNodeListsAttributeChanged()
943 for (Node *n = this; n; n = n->parentNode())
947 void Node::notifyLocalNodeListsChildrenChanged()
967 void Node::notifyNodeListsChildrenChanged()
969 for (Node* n = this; n; n = n->parentNode())
973 Node *Node::traverseNextNode(const Node *stayWithin) const
981 const Node *n = this;
989 Node *Node::traverseNextSibling(const Node *stayWithin) const
995 const Node *n = this;
1003 Node* Node::traverseNextNodePostOrder() const
1005 Node* next = nextSibling();
1008 while (Node* firstChild = next->firstChild())
1013 Node *Node::traversePreviousNode(const Node *stayWithin) const
1018 Node *n = previousSibling();
1026 Node *Node::traversePreviousNodePostOrder(const Node *stayWithin) const
1034 const Node *n = this;
1042 Node* Node::traversePreviousSiblingPostOrder(const Node* stayWithin) const
1048 const Node *n = this;
1056 void Node::checkSetPrefix(const AtomicString& prefix, ExceptionCode& ec)
1058 // Perform error checking as required by spec for setting Node.prefix. Used by
1079 bool Node::canReplaceChild(Node* newChild, Node*)
1085 for (Node *n = newChild->firstChild(); n; n = n->nextSibling()) {
1093 void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec)
1104 // NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly
1113 // created this node.
1129 // HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the
1130 // newChild node, or if the node to append is one of this node's ancestors.
1132 // check for ancestor/same node
1145 for (Node* node = newChild; node; node = node->traverseNextNode(newChild))
1146 node->setDocument(document());
1149 void Node::checkAddChild(Node *newChild, ExceptionCode& ec)
1160 // NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly
1169 // created this node.
1185 // HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the
1186 // newChild node, or if the node to append is one of this node's ancestors.
1188 // check for ancestor/same node
1201 for (Node *n = newChild->firstChild(); n; n = n->nextSibling()) {
1211 for (Node* node = newChild; node; node = node->traverseNextNode(newChild))
1212 node->setDocument(document());
1215 bool Node::isDescendantOf(const Node *other) const
1220 for (const Node *n = parentNode(); n; n = n->parentNode()) {
1227 bool Node::contains(const Node* node) const
1229 if (!node)
1231 return this == node || node->isDescendantOf(this);
1234 bool Node::childAllowed(Node* newChild)
1239 void Node::attach()
1244 // If this node got a renderer it may be the previousRenderer() of sibling text nodes and thus affect the
1247 for (Node* next = nextSibling(); next; next = next->nextSibling()) {
1260 void Node::willRemove()
1264 void Node::detach()
1285 Node *Node::previousEditable() const
1287 Node *node = previousLeafNode();
1288 while (node) {
1289 if (node->isContentEditable())
1290 return node;
1291 node = node->previousLeafNode();
1296 Node *Node::nextEditable() const
1298 Node *node = nextLeafNode();
1299 while (node) {
1300 if (node->isContentEditable())
1301 return node;
1302 node = node->nextLeafNode();
1307 RenderObject * Node::previousRenderer()
1309 for (Node *n = previousSibling(); n; n = n->previousSibling()) {
1316 RenderObject * Node::nextRenderer()
1323 for (Node *n = nextSibling(); n; n = n->nextSibling()) {
1330 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
1331 Node *Node::previousNodeConsideringAtomicNodes() const
1334 Node *n = previousSibling();
1347 Node *Node::nextNodeConsideringAtomicNodes() const
1353 const Node *n = this;
1361 Node *Node::previousLeafNode() const
1363 Node *node = previousNodeConsideringAtomicNodes();
1364 while (node) {
1365 if (isAtomicNode(node))
1366 return node;
1367 node = node->previousNodeConsideringAtomicNodes();
1372 Node *Node::nextLeafNode() const
1374 Node *node = nextNodeConsideringAtomicNodes();
1375 while (node) {
1376 if (isAtomicNode(node))
1377 return node;
1378 node = node->nextNodeConsideringAtomicNodes();
1383 void Node::createRendererIfNeeded()
1390 Node* parent = parentNode();
1414 PassRefPtr<RenderStyle> Node::styleForRenderer()
1427 bool Node::rendererIsNeeded(RenderStyle *style)
1432 RenderObject* Node::createRenderer(RenderArena*, RenderStyle*)
1438 RenderStyle* Node::nonRendererRenderStyle() const
1443 void Node::setRenderStyle(PassRefPtr<RenderStyle> s)
1449 RenderStyle* Node::computedStyle()
1454 int Node::maxCharacterOffset() const
1462 bool Node::canStartSelection() const
1477 Node* Node::shadowAncestorNode()
1488 Node* root = shadowTreeRootNode();
1494 Node* Node::shadowTreeRootNode()
1496 Node* root = this;
1505 bool Node::isInShadowTree()
1507 for (Node* n = this; n; n = n->parentNode())
1513 bool Node::isBlockFlow() const
1518 bool Node::isBlockFlowOrBlockTable() const
1523 bool Node::isEditableBlock() const
1528 Element *Node::enclosingBlockFlowElement() const
1530 Node *n = const_cast<Node *>(this);
1544 Element *Node::enclosingInlineElement() const
1546 Node *n = const_cast<Node *>(this);
1547 Node *p;
1554 for (Node *sibling = n->previousSibling(); sibling; sibling = sibling->previousSibling()) {
1564 Element* Node::rootEditableElement() const
1567 for (Node* n = const_cast<Node*>(this); n && n->isContentEditable(); n = n->parentNode()) {
1576 bool Node::inSameContainingBlockFlowElement(Node *n)
1581 // FIXME: End of obviously misplaced HTML editing functions. Try to move these out of Node.
1583 PassRefPtr<NodeList> Node::getElementsByTagName(const String& name)
1588 PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceURI, const String& localName)
1612 PassRefPtr<NodeList> Node::getElementsByName(const String& elementName)
1627 PassRefPtr<NodeList> Node::getElementsByClassName(const String& classNames)
1642 PassRefPtr<Element> Node::querySelector(const String& selectors, ExceptionCode& ec)
1676 for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) {
1689 PassRefPtr<NodeList> Node::querySelectorAll(const String& selectors, ExceptionCode& ec)
1715 Document *Node::ownerDocument() const
1721 KURL Node::baseURI() const
1726 bool Node::isEqualNode(Node *other) const
1758 Node *child = firstChild();
1759 Node *otherChild = other->firstChild();
1778 bool Node::isDefaultNamespace(const AtomicString& namespaceURIMaybeEmpty) const
1827 String Node::lookupPrefix(const AtomicString &namespaceURI) const
1860 String Node::lookupNamespaceURI(const String &prefix) const
1922 String Node::lookupNamespacePrefix(const AtomicString &_namespaceURI, const Element *originalElement) const
1948 void Node::appendTextContent(bool convertBRsToNewlines, StringBuilder& content) const
1973 for (Node *child = firstChild(); child; child = child->nextSibling()) {
1989 String Node::textContent(bool convertBRsToNewlines) const
1996 void Node::setTextContent(const String &text, ExceptionCode& ec)
2027 Element* Node::ancestorElement() const
2030 for (Node* n = parentNode(); n; n = n->parentNode()) {
2037 bool Node::offsetInCharacters() const
2042 unsigned short Node::compareDocumentPosition(Node* otherNode)
2054 Node* start1 = attr1 ? attr1->ownerElement() : this;
2055 Node* start2 = attr2 ? attr2->ownerElement() : otherNode;
2058 // an orphaned attribute node.
2062 Vector<Node*, 16> chain1;
2063 Vector<Node*, 16> chain2;
2070 // We are comparing two attributes on the same node. Crawl our attribute map
2075 // If neither of the two determining nodes is a child node and nodeType is the same for both determining nodes, then an
2091 // If one node is in the document and the other is not, we must be disconnected.
2099 Node* current;
2109 Node* child1 = chain1[--index1];
2110 Node* child2 = chain2[--index2];
2123 // Otherwise we need to see which node occurs first. Crawl backwards from child2 looking for child1.
2124 for (Node* child = child2->previousSibling(); child; child = child->previousSibling()) {
2139 FloatPoint Node::convertToPage(const FloatPoint& p) const
2154 FloatPoint Node::convertFromPage(const FloatPoint& p) const
2171 static void appendAttributeDesc(const Node* node, String& string, const QualifiedName& name, const char* attrDesc)
2173 if (node->isElementNode()) {
2174 String attr = static_cast<const Element*>(node)->getAttribute(name);
2182 void Node::showNode(const char* prefix) const
2218 void Node::showTreeForThis() const
2223 void Node::showTreeAndMark(const Node* markedNode1, const char* markedLabel1, const Node* markedNode2, const char * markedLabel2) const
2225 const Node* rootNode;
2226 const Node* node = this;
2227 while (node->parentNode() && !node->hasTagName(bodyTag))
2228 node = node->parentNode();
2229 rootNode = node;
2231 for (node = rootNode; node; node = node->traverseNextNode()) {
2235 if (node == markedNode1)
2241 if (node == markedNode2)
2249 for (const Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentNode())
2251 node->showNode(prefix.utf8().data());
2253 for (const Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentNode())
2255 node->showNode();
2260 void Node::formatForDebugger(char* buffer, unsigned length) const
2327 void Node::getSubresourceURLs(ListHashSet<KURL>& urls) const
2332 ContainerNode* Node::eventParentNode()
2334 Node* parent = parentNode();
2339 Node* Node::enclosingLinkEventParentOrSelf()
2341 for (Node* node = this; node; node = node->eventParentNode()) {
2342 // For imagemaps, the enclosing link node is the associated area element not the image itself.
2345 if (node->isLink() && !node->hasTagName(imgTag))
2346 return node;
2355 void* Node::operator new(size_t size)
2361 void* Node::operator new[](size_t size)
2367 void Node::operator delete(void* p, size_t size)
2373 void Node::operator delete[](void* p, size_t size)
2379 size_t Node::reportDOMNodesSize()
2387 ScriptExecutionContext* Node::scriptExecutionContext() const
2392 void Node::insertedIntoDocument()
2397 void Node::removedFromDocument()
2402 void Node::willMoveToNewOwnerDocument()
2408 void Node::didMoveToNewOwnerDocument()
2415 static inline HashSet<SVGElementInstance*> instancesForSVGElement(Node* node)
2419 ASSERT(node);
2420 if (!node->isSVGElement() || node->shadowTreeRootNode())
2423 SVGElement* element = static_cast<SVGElement*>(node);
2434 static inline bool tryAddEventListener(Node* targetNode, const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
2445 bool Node::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
2479 static inline bool tryRemoveEventListener(Node* targetNode, const AtomicString& eventType, EventListener* listener, bool useCapture)
2490 bool Node::removeEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture)
2569 EventTargetData* Node::eventTargetData()
2574 EventTargetData* Node::ensureEventTargetData()
2579 void Node::handleLocalEvents(Event* event)
2591 static inline SVGElementInstance* eventTargetAsSVGElementInstance(Node* referenceNode)
2599 for (Node* n = referenceNode; n; n = n->parentNode()) {
2603 Node* shadowTreeParentElement = n->shadowParentNode();
2614 static inline EventTarget* eventTargetRespectingSVGTargetRules(Node* referenceNode)
2628 void Node::eventAncestors(Vector<RefPtr<ContainerNode> > &ancestors)
2642 bool Node::dispatchEvent(PassRefPtr<Event> prpEvent)
2653 static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, Vector<RefPtr<ContainerNode> >& ancestors)
2658 if (node->hasEventListeners(eventType))
2670 bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
2679 // If the node is not in a document just send the event to it.
2681 RefPtr<Node> thisNode(this);
2690 Node* topLevelContainer = ancestors.isEmpty() ? this : ancestors.last().get();
2702 // Give the target node a chance to do some work before DOM event handlers get a crack.
2792 void Node::dispatchSubtreeModifiedEvent()
2806 void Node::dispatchUIEvent(const AtomicString& eventType, int detail, PassRefPtr<Event> underlyingEvent)
2818 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& key)
2832 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicString& eventType,
2833 int detail, Node* relatedTarget)
2851 void Node::dispatchSimulatedMouseEvent(const AtomicString& eventType,
2873 void Node::dispatchSimulatedClick(PassRefPtr<Event> event, bool sendMouseEvents, bool showPressedLook)
2876 gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
2896 bool Node::dispatchMouseEvent(const AtomicString& eventType, int button, int detail,
2899 bool isSimulated, Node* relatedTargetArg, PassRefPtr<Event> underlyingEvent)
2908 // Dispatching the first event can easily result in this node being destroyed.
2911 RefPtr<Node> protect(this);
2918 RefPtr<Node> relatedTarget = relatedTargetArg;
2965 void Node::dispatchWheelEvent(PlatformWheelEvent& e)
2998 void Node::dispatchFocusEvent()
3003 void Node::dispatchBlurEvent()
3008 bool Node::disabled() const
3013 void Node::defaultEventHandler(Event* event)
3059 void showTree(const WebCore::Node* node)
3061 if (node)
3062 node->showTreeForThis();