Changeset 129164 in webkit
- Timestamp:
- Sep 20, 2012 1:47:41 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129160 r129164 1 2012-09-20 Adam Klein <adamk@chromium.org> 2 3 Rename ContainerNode::parserAddChild "parserAppendChild" for consistency 4 https://bugs.webkit.org/show_bug.cgi?id=97254 5 6 Reviewed by Adam Barth. 7 8 No functional change, all the below changes are simple renames. 9 10 * dom/ContainerNode.cpp: 11 (WebCore::ContainerNode::takeAllChildrenFrom): 12 (WebCore::ContainerNode::parserAppendChild): 13 * dom/ContainerNode.h: 14 (ContainerNode): 15 * dom/DOMImplementation.cpp: 16 (WebCore::DOMImplementation::createDocument): 17 * editing/markup.cpp: 18 (WebCore::createFragmentForTransformToFragment): 19 * html/HTMLViewSourceDocument.cpp: 20 (WebCore::HTMLViewSourceDocument::createContainingTable): 21 (WebCore::HTMLViewSourceDocument::addSpanWithClassName): 22 (WebCore::HTMLViewSourceDocument::addLine): 23 (WebCore::HTMLViewSourceDocument::finishLine): 24 (WebCore::HTMLViewSourceDocument::addText): 25 (WebCore::HTMLViewSourceDocument::addBase): 26 (WebCore::HTMLViewSourceDocument::addLink): 27 * html/parser/HTMLConstructionSite.cpp: 28 (WebCore::executeTask): 29 * html/parser/HTMLTreeBuilder.cpp: 30 (WebCore::HTMLTreeBuilder::callTheAdoptionAgency): 31 * html/track/WebVTTParser.cpp: 32 (WebCore::WebVTTParser::constructTreeFromToken): 33 * xml/XMLErrors.cpp: 34 (WebCore::createXHTMLParserErrorHeader): 35 (WebCore::XMLErrors::insertErrorMessageBlock): 36 * xml/parser/XMLDocumentParser.cpp: 37 (WebCore::XMLDocumentParser::enterText): 38 (WebCore::XMLDocumentParser::parseDocumentFragment): 39 * xml/parser/XMLDocumentParserLibxml2.cpp: 40 (WebCore::XMLDocumentParser::startElementNs): 41 (WebCore::XMLDocumentParser::processingInstruction): 42 (WebCore::XMLDocumentParser::cdataBlock): 43 (WebCore::XMLDocumentParser::comment): 44 (WebCore::XMLDocumentParser::internalSubset): 45 * xml/parser/XMLDocumentParserQt.cpp: 46 (WebCore::XMLDocumentParser::parseStartElement): 47 (WebCore::XMLDocumentParser::parseProcessingInstruction): 48 (WebCore::XMLDocumentParser::parseCdata): 49 (WebCore::XMLDocumentParser::parseComment): 50 (WebCore::XMLDocumentParser::parseDtd): 51 * xml/parser/XMLTreeBuilder.cpp: 52 (WebCore::XMLTreeBuilder::processDOCTYPE): 53 (WebCore::XMLTreeBuilder::processStartTag): 54 (WebCore::XMLTreeBuilder::add): 55 1 56 2012-09-20 James Robinson <jamesr@chromium.org> 2 57 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r128679 r129164 104 104 RefPtr<Node> child = document()->adoptNode(children[i].release(), ec); 105 105 ASSERT(!ec); 106 parserA ddChild(child.get());106 parserAppendChild(child.get()); 107 107 // FIXME: Together with adoptNode above, the tree scope might get updated recursively twice 108 108 // (if the document changed or oldParent was in a shadow tree, AND *this is in a shadow tree). … … 601 601 } 602 602 603 void ContainerNode::parserA ddChild(PassRefPtr<Node> newChild)603 void ContainerNode::parserAppendChild(PassRefPtr<Node> newChild) 604 604 { 605 605 ASSERT(newChild); -
trunk/Source/WebCore/dom/ContainerNode.h
r128762 r129164 61 61 // They don't send DOM mutation events or handle reparenting. 62 62 // However, arbitrary code may be run by beforeload handlers. 63 void parserA ddChild(PassRefPtr<Node>);63 void parserAppendChild(PassRefPtr<Node>); 64 64 void parserRemoveChild(Node*); 65 65 void parserInsertBefore(PassRefPtr<Node> newChild, Node* refChild); -
trunk/Source/WebCore/dom/DOMImplementation.cpp
r121053 r129164 318 318 // FIXME: Shouldn't this call appendChild instead? 319 319 if (doctype) 320 doc->parserA ddChild(doctype);320 doc->parserAppendChild(doctype); 321 321 if (documentElement) 322 doc->parserA ddChild(documentElement.release());322 doc->parserAppendChild(documentElement.release()); 323 323 324 324 return doc.release(); -
trunk/Source/WebCore/editing/markup.cpp
r127062 r129164 1027 1027 fragment->parseHTML(sourceString, fakeBody.get()); 1028 1028 } else if (sourceMIMEType == "text/plain") 1029 fragment->parserA ddChild(Text::create(outputDoc, sourceString));1029 fragment->parserAppendChild(Text::create(outputDoc, sourceString)); 1030 1030 else { 1031 1031 bool successfulParse = fragment->parseXML(sourceString, 0); -
trunk/Source/WebCore/html/HTMLViewSourceDocument.cpp
r125878 r129164 71 71 { 72 72 RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(this); 73 parserA ddChild(html);73 parserAppendChild(html); 74 74 html->attach(); 75 75 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(this); 76 html->parserA ddChild(body);76 html->parserAppendChild(body); 77 77 body->attach(); 78 78 … … 81 81 RefPtr<HTMLDivElement> div = HTMLDivElement::create(this); 82 82 div->setAttribute(classAttr, "webkit-line-gutter-backdrop"); 83 body->parserA ddChild(div);83 body->parserAppendChild(div); 84 84 div->attach(); 85 85 86 86 RefPtr<HTMLTableElement> table = HTMLTableElement::create(this); 87 body->parserA ddChild(table);87 body->parserAppendChild(table); 88 88 table->attach(); 89 89 m_tbody = HTMLTableSectionElement::create(tbodyTag, this); 90 table->parserA ddChild(m_tbody);90 table->parserAppendChild(m_tbody); 91 91 m_tbody->attach(); 92 92 m_current = m_tbody; … … 187 187 RefPtr<HTMLElement> span = HTMLElement::create(spanTag, this); 188 188 span->setAttribute(classAttr, className); 189 m_current->parserA ddChild(span);189 m_current->parserAppendChild(span); 190 190 span->attach(); 191 191 return span.release(); … … 196 196 // Create a table row. 197 197 RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(this); 198 m_tbody->parserA ddChild(trow);198 m_tbody->parserAppendChild(trow); 199 199 trow->attach(); 200 200 … … 202 202 RefPtr<HTMLTableCellElement> td = HTMLTableCellElement::create(tdTag, this); 203 203 td->setAttribute(classAttr, "webkit-line-number"); 204 trow->parserA ddChild(td);204 trow->parserAppendChild(td); 205 205 td->attach(); 206 206 … … 208 208 td = HTMLTableCellElement::create(tdTag, this); 209 209 td->setAttribute(classAttr, "webkit-line-content"); 210 trow->parserA ddChild(td);210 trow->parserAppendChild(td); 211 211 td->attach(); 212 212 m_current = m_td = td; … … 230 230 if (!m_current->hasChildNodes()) { 231 231 RefPtr<HTMLBRElement> br = HTMLBRElement::create(this); 232 m_current->parserA ddChild(br);232 m_current->parserAppendChild(br); 233 233 br->attach(); 234 234 } … … 256 256 } 257 257 RefPtr<Text> t = Text::create(this, substring); 258 m_current->parserA ddChild(t);258 m_current->parserAppendChild(t); 259 259 t->attach(); 260 260 if (i < size - 1) … … 286 286 RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(baseTag, this); 287 287 base->setAttribute(hrefAttr, href); 288 m_current->parserA ddChild(base);288 m_current->parserAppendChild(base); 289 289 base->attach(); 290 290 return base.release(); … … 306 306 anchor->setAttribute(targetAttr, "_blank"); 307 307 anchor->setAttribute(hrefAttr, url); 308 m_current->parserA ddChild(anchor);308 m_current->parserAppendChild(anchor); 309 309 anchor->attach(); 310 310 return anchor.release(); -
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r124537 r129164 81 81 task.parent->parserInsertBefore(task.child.get(), task.nextChild.get()); 82 82 else 83 task.parent->parserA ddChild(task.child.get());83 task.parent->parserAppendChild(task.child.get()); 84 84 85 85 // JavaScript run from beforeload (or DOM Mutation or event handlers) -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r128373 r129164 1489 1489 if (ContainerNode* parent = lastNode->element()->parentNode()) 1490 1490 parent->parserRemoveChild(lastNode->element()); 1491 node->element()->parserA ddChild(lastNode->element());1491 node->element()->parserAppendChild(lastNode->element()); 1492 1492 if (lastNode->element()->parentElement()->attached() && !lastNode->element()->attached()) 1493 1493 lastNode->element()->lazyAttach(); … … 1501 1501 m_tree.fosterParent(lastNode->element()); 1502 1502 else { 1503 commonAncestor->node()->parserA ddChild(lastNode->element());1503 commonAncestor->node()->parserAppendChild(lastNode->element()); 1504 1504 ASSERT(lastNode->stackItem()->isElementNode()); 1505 1505 ASSERT(lastNode->element()->parentNode()); … … 1513 1513 // 13. 1514 1514 Element* furthestBlockElement = furthestBlock->element(); 1515 // FIXME: All this creation / parserA ddChild / attach business should1515 // FIXME: All this creation / parserAppendChild / attach business should 1516 1516 // be in HTMLConstructionSite. My guess is that steps 11--15 1517 1517 // should all be in some HTMLConstructionSite function. 1518 furthestBlockElement->parserA ddChild(newItem->element());1518 furthestBlockElement->parserAppendChild(newItem->element()); 1519 1519 // FIXME: Why is this attach logic necessary? Style resolve should attach us if needed. 1520 1520 if (furthestBlockElement->attached() && !newItem->element()->attached()) { -
trunk/Source/WebCore/html/track/WebVTTParser.cpp
r126350 r129164 352 352 String content(m_token.characters().data(), m_token.characters().size()); 353 353 RefPtr<Text> child = Text::create(document, content); 354 m_currentNode->parserA ddChild(child);354 m_currentNode->parserAppendChild(child); 355 355 break; 356 356 } … … 369 369 if (child->hasTagName(qTag)) 370 370 child->setAttribute(titleAttr, AtomicString(m_token.annotation().data(), m_token.annotation().size())); 371 m_currentNode->parserA ddChild(child);371 m_currentNode->parserAppendChild(child); 372 372 m_currentNode = child; 373 373 } … … 386 386 double time = collectTimeStamp(m_token.characters().data(), &position); 387 387 if (time != malformedTime) 388 m_currentNode->parserA ddChild(ProcessingInstruction::create(document, "timestamp", String(m_token.characters().data(), m_token.characters().size())));388 m_currentNode->parserAppendChild(ProcessingInstruction::create(document, "timestamp", String(m_token.characters().data(), m_token.characters().size()))); 389 389 break; 390 390 } -
trunk/Source/WebCore/xml/XMLErrors.cpp
r128014 r129164 97 97 98 98 RefPtr<Element> h3 = doc->createElement(h3Tag, true); 99 reportElement->parserA ddChild(h3.get());100 h3->parserA ddChild(doc->createTextNode("This page contains the following errors:"));99 reportElement->parserAppendChild(h3.get()); 100 h3->parserAppendChild(doc->createTextNode("This page contains the following errors:")); 101 101 102 102 RefPtr<Element> fixed = doc->createElement(divTag, true); … … 104 104 fixedAttributes.append(Attribute(styleAttr, "font-family:monospace;font-size:12px")); 105 105 fixed->parserSetAttributes(fixedAttributes, DisallowScriptingContent); 106 reportElement->parserA ddChild(fixed.get());106 reportElement->parserAppendChild(fixed.get()); 107 107 108 fixed->parserA ddChild(doc->createTextNode(errorMessages));108 fixed->parserAppendChild(doc->createTextNode(errorMessages)); 109 109 110 110 h3 = doc->createElement(h3Tag, true); 111 reportElement->parserA ddChild(h3.get());112 h3->parserA ddChild(doc->createTextNode("Below is a rendering of the page up to the first error."));111 reportElement->parserAppendChild(h3.get()); 112 h3->parserAppendChild(doc->createTextNode("Below is a rendering of the page up to the first error.")); 113 113 114 114 return reportElement.release(); … … 126 126 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); 127 127 RefPtr<Element> body = m_document->createElement(bodyTag, true); 128 rootElement->parserA ddChild(body);129 m_document->parserA ddChild(rootElement);128 rootElement->parserAppendChild(body); 129 m_document->parserAppendChild(rootElement); 130 130 if (m_document->attached() && !rootElement->attached()) 131 131 rootElement->attach(); … … 136 136 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); 137 137 RefPtr<Element> body = m_document->createElement(bodyTag, true); 138 rootElement->parserA ddChild(body);138 rootElement->parserAppendChild(body); 139 139 140 140 documentElement->parentNode()->parserRemoveChild(documentElement.get()); … … 142 142 documentElement->detach(); 143 143 144 body->parserA ddChild(documentElement);145 m_document->parserA ddChild(rootElement.get());144 body->parserAppendChild(documentElement); 145 m_document->parserAppendChild(rootElement.get()); 146 146 147 147 if (m_document->attached()) … … 163 163 RefPtr<Element> paragraph = m_document->createElement(pTag, true); 164 164 paragraph->parserSetAttributes(attributes, DisallowScriptingContent); 165 paragraph->parserA ddChild(m_document->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result."));166 reportElement->parserA ddChild(paragraph.release());165 paragraph->parserAppendChild(m_document->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result.")); 166 reportElement->parserAppendChild(paragraph.release()); 167 167 } 168 168 #endif … … 172 172 documentElement->parserInsertBefore(reportElement, documentElement->firstChild()); 173 173 else 174 documentElement->parserA ddChild(reportElement);174 documentElement->parserAppendChild(reportElement); 175 175 176 176 if (documentElement->attached() && !reportElement->attached()) -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r127366 r129164 148 148 ASSERT(!m_leafTextNode); 149 149 m_leafTextNode = Text::create(document(), ""); 150 m_currentNode->parserA ddChild(m_leafTextNode.get());150 m_currentNode->parserAppendChild(m_leafTextNode.get()); 151 151 } 152 152 … … 296 296 // For now we have a hack for script/style innerHTML support: 297 297 if (contextElement && (contextElement->hasLocalName(HTMLNames::scriptTag) || contextElement->hasLocalName(HTMLNames::styleTag))) { 298 fragment->parserA ddChild(fragment->document()->createTextNode(chunk));298 fragment->parserAppendChild(fragment->document()->createTextNode(chunk)); 299 299 return true; 300 300 } -
trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
r128572 r129164 817 817 m_scriptStartPosition = textPosition(); 818 818 819 m_currentNode->parserA ddChild(newElement.get());819 m_currentNode->parserAppendChild(newElement.get()); 820 820 821 821 pushCurrentNode(newElement.get()); … … 969 969 pi->setCreatedByParser(true); 970 970 971 m_currentNode->parserA ddChild(pi.get());971 m_currentNode->parserAppendChild(pi.get()); 972 972 if (m_view && !pi->attached()) 973 973 pi->attach(); … … 997 997 998 998 RefPtr<CDATASection> newNode = CDATASection::create(document(), toString(s, len)); 999 m_currentNode->parserA ddChild(newNode.get());999 m_currentNode->parserAppendChild(newNode.get()); 1000 1000 if (m_view && !newNode->attached()) 1001 1001 newNode->attach(); … … 1015 1015 1016 1016 RefPtr<Comment> newNode = Comment::create(document(), toString(s)); 1017 m_currentNode->parserA ddChild(newNode.get());1017 m_currentNode->parserAppendChild(newNode.get()); 1018 1018 if (m_view && !newNode->attached()) 1019 1019 newNode->attach(); … … 1060 1060 1061 1061 if (document()) 1062 document()->parserA ddChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID)));1062 document()->parserAppendChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID))); 1063 1063 } 1064 1064 -
trunk/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp
r127366 r129164 481 481 m_scriptStartPosition = textPosition(); 482 482 483 m_currentNode->parserA ddChild(newElement.get());483 m_currentNode->parserAppendChild(newElement.get()); 484 484 485 485 pushCurrentNode(newElement.get()); … … 573 573 pi->setCreatedByParser(true); 574 574 575 m_currentNode->parserA ddChild(pi.get());575 m_currentNode->parserAppendChild(pi.get()); 576 576 if (m_view && !pi->attached()) 577 577 pi->attach(); … … 594 594 RefPtr<CDATASection> newNode = CDATASection::create(document(), m_stream.text()); 595 595 596 m_currentNode->parserA ddChild(newNode.get());596 m_currentNode->parserAppendChild(newNode.get()); 597 597 if (m_view && !newNode->attached()) 598 598 newNode->attach(); … … 605 605 RefPtr<Comment> newNode = Comment::create(document(), m_stream.text()); 606 606 607 m_currentNode->parserA ddChild(newNode.get());607 m_currentNode->parserAppendChild(newNode.get()); 608 608 if (m_view && !newNode->attached()) 609 609 newNode->attach(); … … 637 637 setIsXHTMLDocument(true); // controls if we replace entities or not. 638 638 if (!m_parsingFragment) 639 document()->parserA ddChild(DocumentType::create(document(), name, publicId, systemId));640 641 } 642 } 639 document()->parserAppendChild(DocumentType::create(document(), name, publicId, systemId)); 640 641 } 642 } -
trunk/Source/WebCore/xml/parser/XMLTreeBuilder.cpp
r127300 r129164 215 215 RefPtr<DocumentType> doctype = DocumentType::create(m_document, token.name(), publicIdentifier, systemIdentifier); 216 216 m_document->setDocType(doctype); 217 m_document->parserA ddChild(doctype);217 m_document->parserAppendChild(doctype); 218 218 219 219 if ((publicIdentifier == xhtmlTransitional) … … 245 245 246 246 newElement->beginParsingChildren(); 247 m_currentNodeStack.last().node()->parserA ddChild(newElement.get());247 m_currentNodeStack.last().node()->parserAppendChild(newElement.get()); 248 248 249 249 top.setNode(newElement); … … 389 389 inline void XMLTreeBuilder::add(PassRefPtr<Node> node) 390 390 { 391 m_currentNodeStack.last().node()->parserA ddChild(node.get());391 m_currentNodeStack.last().node()->parserAppendChild(node.get()); 392 392 if (!node->attached()) 393 393 node->attach();
Note: See TracChangeset
for help on using the changeset viewer.