Lines Matching full:node
79 HTMLStackElem(const AtomicString& t, int lvl, Node* n, bool r, HTMLStackElem* nx)
83 , node(n)
92 node->deref();
98 Node* node;
200 void HTMLParser::setCurrent(Node* newCurrent)
211 inline static int tagPriorityOfNode(Node* n)
224 inline bool HTMLParser::insertNodeAfterLimitBlockDepth(Node* n, bool flat)
230 PassRefPtr<Node> HTMLParser::parseToken(Token* t)
262 RefPtr<Node> n;
274 RefPtr<Node> n = getNode(t);
289 // If the node does not have a forbidden end tag requirement, and if the broken XML self-closing
300 // we couldn't insert the node
327 // Make a new doctype node and set it as our doctype.
331 static bool isTableSection(const Node* n)
336 static bool isTablePart(const Node* n)
342 static bool isTableRelated(const Node* n)
352 bool HTMLParser::insertNode(Node* n, bool flat)
354 RefPtr<Node> protectNode(n);
370 Node* newNode = m_current->addChild(n);
409 bool HTMLParser::handleError(Node* n, bool flat, const AtomicString& localName, int tagPriority)
471 Node* newNode = m_head->addChild(n);
601 Node* node = m_current;
602 Node* parent = node->parentNode();
603 // A script may have removed the current node's parent from the DOM
605 // FIXME: we should do real recovery here and re-parent with the correct node.
608 Node* grandparent = parent->parentNode();
614 !n->hasTagName(formTag) && !n->hasTagName(scriptTag)) && isTableSection(node) &&
616 node = (node->hasTagName(tableTag)) ? node :
617 ((node->hasTagName(trTag)) ? grandparent : parent);
619 if (!node)
621 Node* parent = node->parentNode();
624 parent->insertBefore(n, node, ec);
711 typedef bool (HTMLParser::*CreateErrorCheckFunc)(Token* t, RefPtr<Node>&);
714 bool HTMLParser::textCreateErrorCheck(Token* t, RefPtr<Node>& result)
720 bool HTMLParser::commentCreateErrorCheck(Token* t, RefPtr<Node>& result)
726 bool HTMLParser::headCreateErrorCheck(Token*, RefPtr<Node>& result)
736 bool HTMLParser::bodyCreateErrorCheck(Token*, RefPtr<Node>&)
752 bool HTMLParser::framesetCreateErrorCheck(Token*, RefPtr<Node>&)
772 bool HTMLParser::formCreateErrorCheck(Token* t, RefPtr<Node>& result)
784 bool HTMLParser::isindexCreateErrorCheck(Token* t, RefPtr<Node>& result)
786 RefPtr<Node> n = handleIsindex(t);
796 bool HTMLParser::selectCreateErrorCheck(Token*, RefPtr<Node>&)
801 bool HTMLParser::ddCreateErrorCheck(Token* t, RefPtr<Node>& result)
809 bool HTMLParser::dtCreateErrorCheck(Token* t, RefPtr<Node>& result)
817 bool HTMLParser::rpCreateErrorCheck(Token*, RefPtr<Node>&)
824 bool HTMLParser::rtCreateErrorCheck(Token*, RefPtr<Node>&)
831 bool HTMLParser::nestedCreateErrorCheck(Token* t, RefPtr<Node>&)
837 bool HTMLParser::nestedPCloserCreateErrorCheck(Token* t, RefPtr<Node>& result)
844 bool HTMLParser::nestedStyleCreateErrorCheck(Token* t, RefPtr<Node>&)
849 bool HTMLParser::tableCellCreateErrorCheck(Token*, RefPtr<Node>&)
856 bool HTMLParser::tableSectionCreateErrorCheck(Token*, RefPtr<Node>&)
864 bool HTMLParser::noembedCreateErrorCheck(Token*, RefPtr<Node>&)
870 bool HTMLParser::noframesCreateErrorCheck(Token*, RefPtr<Node>&)
876 bool HTMLParser::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
886 bool HTMLParser::pCloserCreateErrorCheck(Token*, RefPtr<Node>&)
893 bool HTMLParser::pCloserStrictCreateErrorCheck(Token*, RefPtr<Node>&)
902 bool HTMLParser::mapCreateErrorCheck(Token*, RefPtr<Node>& result)
909 PassRefPtr<Node> HTMLParser::getNode(Token* t)
979 RefPtr<Node> result;
1044 bool HTMLParser::isInline(Node* node) const
1046 if (node->isTextNode())
1049 if (node->isHTMLElement()) {
1050 HTMLElement* e = static_cast<HTMLElement*>(node);
1163 Node* residualElem = prev->node;
1164 Node* blockElem = prevMaxElem ? prevMaxElem->node : m_current;
1165 Node* parentElem = elem->node;
1176 if (maxElem->node->parentNode() != elem->node) {
1188 prevElem->node = currElem->node;
1205 RefPtr<Node> prevNode = 0;
1207 while (currElem->node != residualElem) {
1208 if (isResidualStyleTag(currElem->node->localName())) {
1211 Node* currNode = currElem->node->cloneNode(false).releaseRef();
1214 // Change the stack element's node to point to the clone.
1217 currElem->node = currNode;
1220 // Attach the previous node as a child of this new node.
1234 elem->node->appendChild(prevNode, ec); // FIXME: This append can result in weird stuff happening, like an inline chain being put into a table section.
1253 Node* newNodePtr = 0;
1256 RefPtr<Node> newNode = residualElem->cloneNode(false); // Shallow clone. We don't pick up the same kids.
1263 Node* currNode = blockElem->firstChild();
1265 Node* nextNode = currNode->nextSibling();
1281 // the node associated with the previous stack element so that when it gets popped,
1282 // it doesn't make the residual element the next current node.
1291 prevElem->node = elem->node;
1296 // node is effectively no longer open.
1298 elem->node = prevMaxElem->node;
1303 prevMaxElem->node = newNodePtr;
1333 // We also set curr->node to be the actual element that corresponds to the ID stored in
1334 // curr->id rather than the node that you should pop to when the element gets pulled off
1336 if (residualStyleStack && curr->tagName == residualStyleStack->tagName && curr->node->attributes()->mapsEquivalent(residualStyleStack->node->attributes()))
1356 void HTMLParser::reopenResidualStyleTags(HTMLStackElem* elem, Node* malformedTableParent)
1360 // Create a shallow clone of the DOM node for this element.
1361 RefPtr<Node> newNode = elem->node->cloneNode(false);
1364 // Append the new node. In the malformed table case, we need to insert before the table,
1373 // Now push a new stack element for this node we just created.
1386 // Update |current| manually to point to the new node.
1440 Node* malformedTableParent = 0;
1456 Node* curr = m_current;
1477 // We also set elem->node to be the actual element that corresponds to the ID stored in
1478 // elem->id rather than the node that you should pop to when the element gets pulled off
1480 if (residualStyleStack && elem->tagName == residualStyleStack->tagName && elem->node->attributes()->mapsEquivalent(residualStyleStack->node->attributes()))
1504 if (m_current && elem->node != m_current)
1512 m_current = elem->node;
1528 // Store the current node before popOneBlockCommon overwrites it.
1529 Node* lastCurrent = m_current;
1540 // We'll be using the stack element we're popping, but for the current node.
1543 // Store the current node before popOneBlockCommon overwrites it.
1544 Node* lastCurrent = m_current;
1547 // Pop the block, but don't deref the current node as popOneBlock does because
1551 // Transfer the current node into the stack element.
1552 // No need to deref the old elem->node because popOneBlockCommon transferred
1554 elem->node = lastCurrent;
1612 PassRefPtr<Node> HTMLParser::handleIsindex(Token* t)
1614 RefPtr<Node> n = new HTMLDivElement(divTag, m_document);
1645 insertNode(m_isindexElement.get(), true /* don't descend into this node */);
1656 // This ensures that "current" is not left pointing to a node when the document is destroyed.