Changeset 62079 in webkit
- Timestamp:
- Jun 28, 2010 8:25:21 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62077 r62079 1 2010-06-28 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Rename ContainerNode::addChild to legacyParserAddChild to indicate its parser-only intended use 6 https://bugs.webkit.org/show_bug.cgi?id=41324 7 8 A bunch of places in the code were calling ContainerNode::addChild. 9 I don't think they actually want to be doing that, as it has special 10 form-related handling which is part of LegacyHTMLTreeBuilder. 11 12 No functional changes, thus no tests. 13 14 * dom/ContainerNode.cpp: 15 (WebCore::ContainerNode::legacyParserAddChild): 16 * dom/ContainerNode.h: 17 * dom/DOMImplementation.cpp: 18 (WebCore::DOMImplementation::createDocument): 19 * dom/Node.cpp: 20 (WebCore::Node::legacyParserAddChild): 21 * dom/Node.h: 22 * html/HTMLKeygenElement.cpp: 23 (WebCore::HTMLKeygenElement::HTMLKeygenElement): 24 * html/HTMLTableElement.cpp: 25 (WebCore::HTMLTableElement::legacyParserAddChild): 26 * html/HTMLTableElement.h: 27 * html/HTMLTableRowElement.cpp: 28 (WebCore::HTMLTableRowElement::legacyParserAddChild): 29 * html/HTMLTableRowElement.h: 30 * html/HTMLTableSectionElement.cpp: 31 (WebCore::HTMLTableSectionElement::legacyParserAddChild): 32 * html/HTMLTableSectionElement.h: 33 * html/HTMLViewSourceDocument.cpp: 34 (WebCore::HTMLViewSourceDocument::createContainingTable): 35 (WebCore::HTMLViewSourceDocument::addSpanWithClassName): 36 (WebCore::HTMLViewSourceDocument::addLine): 37 (WebCore::HTMLViewSourceDocument::addText): 38 (WebCore::HTMLViewSourceDocument::addLink): 39 1 40 2010-06-28 Eric Seidel <eric@webkit.org> 2 41 -
trunk/WebCore/dom/ContainerNode.cpp
r62076 r62079 555 555 } 556 556 557 ContainerNode* ContainerNode:: addChild(PassRefPtr<Node> newChild)557 ContainerNode* ContainerNode::legacyParserAddChild(PassRefPtr<Node> newChild) 558 558 { 559 559 ASSERT(newChild); -
trunk/WebCore/dom/ContainerNode.h
r62076 r62079 49 49 virtual bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&, bool shouldLazyAttach = false); 50 50 51 virtual ContainerNode* addChild(PassRefPtr<Node>);51 virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>); 52 52 virtual void parserAddChild(PassRefPtr<Node>); 53 53 -
trunk/WebCore/dom/DOMImplementation.cpp
r61868 r62079 257 257 } 258 258 259 // FIXME: Shouldn't this call appendChild instead? 259 260 if (doctype) 260 doc-> addChild(doctype);261 doc->legacyParserAddChild(doctype); 261 262 if (documentElement) 262 doc-> addChild(documentElement.release());263 doc->legacyParserAddChild(documentElement.release()); 263 264 264 265 return doc.release(); -
trunk/WebCore/dom/Node.cpp
r62076 r62079 640 640 } 641 641 642 ContainerNode* Node:: addChild(PassRefPtr<Node>)642 ContainerNode* Node::legacyParserAddChild(PassRefPtr<Node>) 643 643 { 644 644 return 0; -
trunk/WebCore/dom/Node.h
r62076 r62079 265 265 // Also does not dispatch DOM mutation events. 266 266 // Returns the appropriate container node for future insertions as you parse, or 0 for failure. 267 virtual ContainerNode* addChild(PassRefPtr<Node>);267 virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>); 268 268 // addChild is tied into the logic of the LegacyHTMLTreeBuilder. We need 269 269 // a "clean" version to use for the HTML5 version of the HTMLTreeBuilder. -
trunk/WebCore/dom/XMLDocumentParser.cpp
r61904 r62079 177 177 #endif 178 178 RefPtr<Node> newNode = Text::create(document(), ""); 179 if (!m_currentNode-> addChild(newNode.get()))179 if (!m_currentNode->legacyParserAddChild(newNode.get())) 180 180 return false; 181 181 pushCurrentNode(newNode.get()); -
trunk/WebCore/dom/XMLDocumentParserLibxml2.cpp
r61985 r62079 791 791 m_scriptStartLine = lineNumber(); 792 792 793 if (!m_currentNode-> addChild(newElement.get())) {793 if (!m_currentNode->legacyParserAddChild(newElement.get())) { 794 794 stopParsing(); 795 795 return; … … 936 936 pi->setCreatedByParser(true); 937 937 938 if (!m_currentNode-> addChild(pi.get()))938 if (!m_currentNode->legacyParserAddChild(pi.get())) 939 939 return; 940 940 if (m_view && !pi->attached()) … … 963 963 964 964 RefPtr<Node> newNode = CDATASection::create(document(), toString(s, len)); 965 if (!m_currentNode-> addChild(newNode.get()))965 if (!m_currentNode->legacyParserAddChild(newNode.get())) 966 966 return; 967 967 if (m_view && !newNode->attached()) … … 982 982 983 983 RefPtr<Node> newNode = Comment::create(document(), toString(s)); 984 m_currentNode-> addChild(newNode.get());984 m_currentNode->legacyParserAddChild(newNode.get()); 985 985 if (m_view && !newNode->attached()) 986 986 newNode->attach(); … … 1046 1046 #endif 1047 1047 1048 document()-> addChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID)));1048 document()->legacyParserAddChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID))); 1049 1049 } 1050 1050 } -
trunk/WebCore/html/HTMLKeygenElement.cpp
r61293 r62079 51 51 for (size_t i = 0; i < keys.size(); ++i) { 52 52 RefPtr<HTMLOptionElement> option = HTMLOptionElement::create(document, this->form()); 53 addChild(option);54 option-> addChild(Text::create(document, keys[i]));53 legacyParserAddChild(option); 54 option->legacyParserAddChild(Text::create(document, keys[i])); 55 55 } 56 56 } -
trunk/WebCore/html/HTMLTableElement.cpp
r61959 r62079 252 252 } 253 253 254 ContainerNode* HTMLTableElement:: addChild(PassRefPtr<Node> child)254 ContainerNode* HTMLTableElement::legacyParserAddChild(PassRefPtr<Node> child) 255 255 { 256 256 if (child->hasTagName(formTag)) { 257 257 // First add the child. 258 HTMLElement:: addChild(child);258 HTMLElement::legacyParserAddChild(child); 259 259 260 260 // Now simply return ourselves as the container to insert into. … … 263 263 } 264 264 265 return HTMLElement:: addChild(child.get());265 return HTMLElement::legacyParserAddChild(child.get()); 266 266 } 267 267 -
trunk/WebCore/html/HTMLTableElement.h
r61959 r62079 64 64 String summary() const; 65 65 66 virtual ContainerNode* addChild(PassRefPtr<Node>);66 virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>); 67 67 68 68 virtual void attach(); -
trunk/WebCore/html/HTMLTableRowElement.cpp
r61959 r62079 63 63 } 64 64 65 ContainerNode* HTMLTableRowElement:: addChild(PassRefPtr<Node> child)65 ContainerNode* HTMLTableRowElement::legacyParserAddChild(PassRefPtr<Node> child) 66 66 { 67 67 if (child->hasTagName(formTag)) { 68 68 // First add the child. 69 HTMLTablePartElement:: addChild(child);69 HTMLTablePartElement::legacyParserAddChild(child); 70 70 71 71 // Now simply return ourselves as the container to insert into. … … 74 74 } 75 75 76 return HTMLTablePartElement:: addChild(child);76 return HTMLTablePartElement::legacyParserAddChild(child); 77 77 } 78 78 -
trunk/WebCore/html/HTMLTableRowElement.h
r61959 r62079 36 36 static PassRefPtr<HTMLTableRowElement> create(const QualifiedName&, Document*); 37 37 38 virtual ContainerNode* addChild(PassRefPtr<Node>);38 virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>); 39 39 40 40 int rowIndex() const; -
trunk/WebCore/html/HTMLTableSectionElement.cpp
r61293 r62079 56 56 } 57 57 58 ContainerNode* HTMLTableSectionElement:: addChild(PassRefPtr<Node> child)58 ContainerNode* HTMLTableSectionElement::legacyParserAddChild(PassRefPtr<Node> child) 59 59 { 60 60 if (child->hasTagName(formTag)) { 61 61 // First add the child. 62 HTMLTablePartElement:: addChild(child);62 HTMLTablePartElement::legacyParserAddChild(child); 63 63 64 64 // Now simply return ourselves as the container to insert into. … … 67 67 } 68 68 69 return HTMLTablePartElement:: addChild(child);69 return HTMLTablePartElement::legacyParserAddChild(child); 70 70 } 71 71 -
trunk/WebCore/html/HTMLTableSectionElement.h
r60361 r62079 35 35 static PassRefPtr<HTMLTableSectionElement> create(const QualifiedName&, Document*); 36 36 37 virtual ContainerNode* addChild(PassRefPtr<Node>);37 virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>); 38 38 39 39 PassRefPtr<HTMLElement> insertRow(int index, ExceptionCode&); -
trunk/WebCore/html/HTMLViewSourceDocument.cpp
r61868 r62079 70 70 { 71 71 RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(this); 72 addChild(html);72 legacyParserAddChild(html); 73 73 html->attach(); 74 74 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(this); 75 html-> addChild(body);75 html->legacyParserAddChild(body); 76 76 body->attach(); 77 77 … … 82 82 attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-gutter-backdrop")); 83 83 div->setAttributeMap(attrs.release()); 84 body-> addChild(div);84 body->legacyParserAddChild(div); 85 85 div->attach(); 86 86 87 87 RefPtr<HTMLTableElement> table = HTMLTableElement::create(this); 88 body-> addChild(table);88 body->legacyParserAddChild(table); 89 89 table->attach(); 90 90 m_tbody = HTMLTableSectionElement::create(tbodyTag, this); 91 table-> addChild(m_tbody);91 table->legacyParserAddChild(m_tbody); 92 92 m_tbody->attach(); 93 93 m_current = m_tbody; … … 215 215 attrs->addAttribute(Attribute::createMapped(classAttr, className)); 216 216 span->setAttributeMap(attrs.release()); 217 m_current-> addChild(span);217 m_current->legacyParserAddChild(span); 218 218 span->attach(); 219 219 return span.release(); … … 224 224 // Create a table row. 225 225 RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(this); 226 m_tbody-> addChild(trow);226 m_tbody->legacyParserAddChild(trow); 227 227 trow->attach(); 228 228 … … 232 232 attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-number")); 233 233 td->setAttributeMap(attrs.release()); 234 trow-> addChild(td);234 trow->legacyParserAddChild(td); 235 235 td->attach(); 236 236 … … 240 240 attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-content")); 241 241 td->setAttributeMap(attrs.release()); 242 trow-> addChild(td);242 trow->legacyParserAddChild(td); 243 243 td->attach(); 244 244 m_current = m_td = td; … … 277 277 addLine(className); 278 278 RefPtr<Text> t = Text::create(this, substring); 279 m_current-> addChild(t);279 m_current->legacyParserAddChild(t); 280 280 t->attach(); 281 281 if (i < size - 1) … … 305 305 attrs->addAttribute(Attribute::createMapped(hrefAttr, url)); 306 306 anchor->setAttributeMap(attrs.release()); 307 m_current-> addChild(anchor);307 m_current->legacyParserAddChild(anchor); 308 308 anchor->attach(); 309 309 return anchor.release(); -
trunk/WebCore/html/LegacyHTMLTreeBuilder.cpp
r62029 r62079 345 345 346 346 // Make a new doctype node and set it as our doctype. 347 m_document-> addChild(DocumentType::create(m_document, String::adopt(t->m_name), String::adopt(t->m_publicID), String::adopt(t->m_systemID)));347 m_document->legacyParserAddChild(DocumentType::create(m_document, String::adopt(t->m_name), String::adopt(t->m_publicID), String::adopt(t->m_systemID))); 348 348 if (t->m_forceQuirks) 349 349 m_document->setParseMode(Document::Compat); … … 391 391 // let's be stupid and just try to insert it. 392 392 // this should work if the document is well-formed 393 Node* newNode = m_current-> addChild(n);393 Node* newNode = m_current->legacyParserAddChild(n); 394 394 if (!newNode) 395 395 return handleError(n, flat, localName, tagPriority); // Try to handle the error. … … 460 460 if (!createdHead) 461 461 reportError(MisplacedHeadContentError, &localName, &m_current->localName()); 462 if (m_head-> addChild(n)) {462 if (m_head->legacyParserAddChild(n)) { 463 463 if (!n->attached() && !m_isParsingFragment) 464 464 n->attach(); 465 465 return true; 466 } else467 466 } 467 return false; 468 468 } 469 469 } else if (h->hasLocalName(htmlTag)) { … … 491 491 } 492 492 if (m_head) { 493 Node* newNode = m_head-> addChild(n);493 Node* newNode = m_head->legacyParserAddChild(n); 494 494 if (!newNode) { 495 495 setSkipMode(h->tagQName()); … … 531 531 if (m_currentMapElement) { 532 532 reportError(MisplacedAreaError, &m_current->localName()); 533 m_currentMapElement-> addChild(n);533 m_currentMapElement->legacyParserAddChild(n); 534 534 if (!n->attached() && !m_isParsingFragment) 535 535 n->attach(); … … 1607 1607 } 1608 1608 1609 n-> addChild(HTMLHRElement::create(m_document));1610 n-> addChild(Text::create(m_document, text));1611 n-> addChild(isIndex.release());1612 n-> addChild(HTMLHRElement::create(m_document));1609 n->legacyParserAddChild(HTMLHRElement::create(m_document)); 1610 n->legacyParserAddChild(Text::create(m_document, text)); 1611 n->legacyParserAddChild(isIndex.release()); 1612 n->legacyParserAddChild(HTMLHRElement::create(m_document)); 1613 1613 1614 1614 return n.release(); -
trunk/WebCore/rendering/MediaControlElements.cpp
r61293 r62079 136 136 void MediaControlElement::attachToParent(Element* parent) 137 137 { 138 parent-> addChild(this);138 parent->legacyParserAddChild(this); 139 139 } 140 140 … … 390 390 void MediaControlInputElement::attachToParent(Element* parent) 391 391 { 392 parent-> addChild(this);392 parent->legacyParserAddChild(this); 393 393 } 394 394 -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r61752 r62079 112 112 // For elements without a shadow parent, add the node to the DOM normally. 113 113 if (!m_shadowParent) 114 parent-> addChild(this);114 parent->legacyParserAddChild(this); 115 115 116 116 // Add the renderer to the render tree -
trunk/WebCore/xml/XSLTProcessor.cpp
r61868 r62079 103 103 fragment->parseHTML(sourceString); 104 104 else if (sourceMIMEType == "text/plain") 105 fragment-> addChild(Text::create(outputDoc, sourceString));105 fragment->legacyParserAddChild(Text::create(outputDoc, sourceString)); 106 106 else { 107 107 bool successfulParse = fragment->parseXML(sourceString, outputDoc->documentElement());
Note: See TracChangeset
for help on using the changeset viewer.