Changeset 62207 in webkit
- Timestamp:
- Jun 30, 2010 2:45:19 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62198 r62207 1 2010-06-30 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Add new popUntil(tagName) function and deploy 6 https://bugs.webkit.org/show_bug.cgi?id=41405 7 8 Add a new popUntil function to share some common code 9 between states. There is more code to share here, but this 10 is a start. 11 12 I also filled in a couple similar states to these with the 13 hope of sharing more code, but decided to wait for a later 14 patch. 15 16 No test changes, since this code doesn't do enough yet to 17 pass any more subtests. Lack of generateImpliedEndTags is the main 18 blocking issue. 19 20 * html/HTMLElementStack.cpp: 21 (WebCore::HTMLElementStack::popUntil): 22 * html/HTMLElementStack.h: 23 * html/HTMLTreeBuilder.cpp: 24 (WebCore::HTMLTreeBuilder::processEndTag): 25 1 26 2010-06-30 Xan Lopez <xlopez@igalia.com> 2 27 -
trunk/WebCore/html/HTMLElementStack.cpp
r62196 r62207 78 78 } 79 79 80 void HTMLElementStack::popUntil(const AtomicString& tagName) 81 { 82 while (!top()->hasLocalName(tagName)) { 83 // pop() will ASSERT at <body> if callers fail to check that there is an 84 // element with localName |tagName| on the stack of open elements. 85 pop(); 86 } 87 } 88 80 89 void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<Element> element) 81 90 { -
trunk/WebCore/html/HTMLElementStack.h
r62196 r62207 49 49 50 50 void pop(); 51 void popUntil(const AtomicString& tagName); 51 52 void popHTMLHeadElement(); 52 53 -
trunk/WebCore/html/HTMLTreeBuilder.cpp
r62196 r62207 662 662 if (currentElement()->tagQName() != token.name()) 663 663 parseError(token); 664 while (currentElement()->tagQName() != token.name()) 665 m_openElements.pop(); 664 m_openElements.popUntil(token.name()); 666 665 m_openElements.pop(); 667 666 } … … 682 681 } 683 682 if (token.name() == liTag) { 683 if (!m_openElements.inListItemScope(token.name())) { 684 parseError(token); 685 return; 686 } 684 687 notImplemented(); 685 688 return; 686 689 } 687 690 if (token.name() == ddTag || token.name() == dtTag) { 691 if (!m_openElements.inScope(token.name())) { 692 parseError(token); 693 return; 694 } 688 695 notImplemented(); 689 696 return; 690 697 } 691 698 if (token.name() == h1Tag || token.name() == h2Tag || token.name() == h3Tag || token.name() == h4Tag || token.name() == h5Tag || token.name() == h6Tag) { 692 notImplemented(); 699 if (!m_openElements.inScope(token.name())) { 700 parseError(token); 701 return; 702 } 703 generateImpliedEndTags(); 704 if (!currentElement()->hasLocalName(token.name())) 705 parseError(token); 706 m_openElements.popUntil(token.name()); 707 m_openElements.pop(); 693 708 return; 694 709 } … … 710 725 if (currentElement()->tagQName() != token.name()) 711 726 parseError(token); 712 while (currentElement()->tagQName() != token.name()) 713 m_openElements.pop(); 727 m_openElements.popUntil(token.name()); 714 728 m_openElements.pop(); 715 729 // FIXME: m_activeFormattingElements should be more interesting … … 731 745 if (!m_openElements.inScope(token.name())) 732 746 return; 733 while (currentElement()->tagQName() != token.name()) 734 m_openElements.pop(); 747 m_openElements.popUntil(token.name()); 735 748 m_openElements.pop(); 736 749 break;
Note: See TracChangeset
for help on using the changeset viewer.