Changeset 61974 in webkit
- Timestamp:
- Jun 27, 2010 4:19:15 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r61973 r61974 1 2010-06-27 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Clean up some loose ends in HTML5 tree builder 6 https://bugs.webkit.org/show_bug.cgi?id=41265 7 8 This patch cleans up a few loose ends in HTML5 tree builder. 9 Technically, we could do each of these as individual patches, but that 10 didn't seem worth while. 11 12 * html/HTMLTreeBuilder.cpp: 13 (WebCore::HTMLTreeBuilder::processStartTag): 14 - Add missing break before default case statement. I don't think 15 this change is observable. 16 (WebCore::HTMLTreeBuilder::processComment): 17 - Originally I thought that comments had special processing in the 18 InHeadNoscriptMode, but it turns out that when you unwind the 19 definitions, it amounts to exactly the same thing. 20 (WebCore::HTMLTreeBuilder::processEndOfFile): 21 - Add missing break before default case statement. I don't think 22 this change is observable. 23 (WebCore::HTMLTreeBuilder::insertComment): 24 - Eliminate one unnecessary ref/deref pair. 25 (WebCore::HTMLTreeBuilder::insertSelfClosingElement): 26 - When we insert self-closing elements, there's no reason to push 27 them onto the stack of open elements just to pop them off again. 28 This change saves a malloc/free pair as well as a ref/deref pair. 29 Go team. 30 * html/HTMLTreeBuilder.h: 31 - Remove unused function. 32 1 33 2010-06-27 Adam Barth <abarth@webkit.org> 2 34 -
trunk/WebCore/html/HTMLTreeBuilder.cpp
r61973 r61974 373 373 processDefaultForInHeadNoscriptMode(token); 374 374 processToken(token); 375 break; 375 376 default: 376 377 notImplemented(); … … 463 464 void HTMLTreeBuilder::processComment(AtomicHTMLToken& token) 464 465 { 465 if (insertionMode() == InHeadNoscriptMode) {466 notImplemented();467 return;468 }469 466 insertComment(token); 470 467 } … … 511 508 processDefaultForInHeadNoscriptMode(token); 512 509 processToken(token); 510 break; 513 511 default: 514 512 notImplemented(); … … 608 606 { 609 607 ASSERT(token.type() == HTMLToken::Comment); 610 RefPtr<Node> element = Comment::create(m_document, token.comment()); 611 currentElement()->addChild(element); 608 currentElement()->addChild(Comment::create(m_document, token.comment())); 612 609 } 613 610 … … 615 612 { 616 613 ASSERT(token.type() == HTMLToken::StartTag); 617 RefPtr<Element> element = HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, token.name(), xhtmlNamespaceURI), m_document, 0);614 RefPtr<Element> element = createElement(token); 618 615 currentElement()->addChild(element); 619 616 m_openElements.push(element.release()); … … 623 620 { 624 621 ASSERT(token.type() == HTMLToken::StartTag); 625 insertElement(token); 626 m_openElements.pop(); 622 currentElement()->addChild(createElement(token)); 627 623 // FIXME: Do we want to acknowledge the token's self-closing flag? 628 624 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#acknowledge-self-closing-flag 629 }630 631 void HTMLTreeBuilder::insertCharacter(UChar cc)632 {633 ASSERT_UNUSED(cc, cc);634 625 } 635 626 … … 663 654 } 664 655 656 PassRefPtr<Element> HTMLTreeBuilder::createElement(AtomicHTMLToken& token) 657 { 658 return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, token.name(), xhtmlNamespaceURI), m_document, 0); 659 } 660 665 661 void HTMLTreeBuilder::finished() 666 662 { -
trunk/WebCore/html/HTMLTreeBuilder.h
r61973 r61974 180 180 void insertElement(AtomicHTMLToken&); 181 181 void insertSelfClosingElement(AtomicHTMLToken&); 182 void insertCharacter(UChar cc);183 182 void insertGenericRCDATAElement(AtomicHTMLToken&); 184 183 void insertGenericRawTextElement(AtomicHTMLToken&); … … 187 186 void insertHTMLStartTagBeforeHTML(AtomicHTMLToken&); 188 187 void insertHTMLStartTagInBody(AtomicHTMLToken&); 188 189 PassRefPtr<Element> createElement(AtomicHTMLToken&); 189 190 190 191 Element* currentElement() { return m_openElements.top(); }
Note: See TracChangeset
for help on using the changeset viewer.