Changeset 62498 in webkit


Ignore:
Timestamp:
Jul 5, 2010 12:42:01 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-07-05 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Finish implementing "any other end tag" for "in body" mode
https://bugs.webkit.org/show_bug.cgi?id=41582

  • html5lib/resources/inbody01.dat: Added.
  • html5lib/runner-expected-html5.txt:
    • Update the one result which was affected by this. That test would pass if we had text node coalescing.
  • html5lib/runner-expected.txt:
    • Update to add the extra test suite.
  • html5lib/runner.html:

2010-07-05 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Finish implementing "any other end tag" for "in body" mode
https://bugs.webkit.org/show_bug.cgi?id=41582

I believe I found a "bug" in the HTML5 spec when writing this:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10080

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody): (WebCore::HTMLTreeBuilder::processEndTag):
  • html/HTMLTreeBuilder.h:
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62495 r62498  
     12010-07-05  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Finish implementing "any other end tag" for "in body" mode
     6        https://bugs.webkit.org/show_bug.cgi?id=41582
     7
     8        * html5lib/resources/inbody01.dat: Added.
     9        * html5lib/runner-expected-html5.txt:
     10         - Update the one result which was affected by this.
     11           That test would pass if we had text node coalescing.
     12        * html5lib/runner-expected.txt:
     13         - Update to add the extra test suite.
     14        * html5lib/runner.html:
     15
     16
    1172010-07-05  Yury Semikhatsky  <yury@yurys-imac.local>
    218
  • trunk/LayoutTests/html5lib/runner-expected-html5.txt

    r62474 r62498  
    504504|           <div>
    505505|             "C"
    506 |         "D"
     506|             "D"
    507507Expected:
    508508| <html>
     
    55845584|       "3"
    55855585|     <table>
     5586resources/inbody01.dat: PASS
    55865587#EOF
  • trunk/LayoutTests/html5lib/runner-expected.txt

    r62468 r62498  
    49364936|       "3"
    49374937|     <table>
     4938resources/inbody01.dat: PASS
  • trunk/LayoutTests/html5lib/runner.html

    r62468 r62498  
    6060        'resources/entities02.dat',
    6161        'resources/comments01.dat',
    62         'resources/adoption01.dat'
     62        'resources/adoption01.dat',
     63        'resources/inbody01.dat'
    6364    ],
    6465    tests = [],
  • trunk/WebCore/ChangeLog

    r62497 r62498  
     12010-07-05  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Finish implementing "any other end tag" for "in body" mode
     6        https://bugs.webkit.org/show_bug.cgi?id=41582
     7
     8        I believe I found a "bug" in the HTML5 spec when writing this:
     9        http://www.w3.org/Bugs/Public/show_bug.cgi?id=10080
     10
     11        * html/HTMLTreeBuilder.cpp:
     12        (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
     13        (WebCore::HTMLTreeBuilder::processEndTag):
     14        * html/HTMLTreeBuilder.h:
     15
    1162010-07-05  Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r62474 r62498  
    882882}
    883883
     884void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken& token)
     885{
     886    HTMLElementStack::ElementRecord* record = m_openElements.topRecord();
     887    while (1) {
     888        Element* node = record->element();
     889        if (node->hasLocalName(token.name())) {
     890            generateImpliedEndTags();
     891            if (!currentElement()->hasLocalName(token.name())) {
     892                parseError(token);
     893                // FIXME: This is either a bug in the spec, or a bug in our
     894                // implementation.  Filed a bug with HTML5:
     895                // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10080
     896                // We might have already popped the node for the token in
     897                // generateImpliedEndTags, just abort.
     898                if (!m_openElements.contains(node))
     899                    return;
     900            }
     901            m_openElements.popUntil(node);
     902            m_openElements.pop();
     903            return;
     904        }
     905        // !phrasing && !formatting == scoping || special
     906        const AtomicString& tagName = node->localName();
     907        if (isScopingTag(tagName) || isSpecialTag(tagName)) {
     908            parseError(token);
     909            return;
     910        }
     911        record = record->next();
     912    }
     913}
     914
    884915// FIXME: This probably belongs on HTMLElementStack.
    885916HTMLElementStack::ElementRecord* HTMLTreeBuilder::furthestBlockForFormattingElement(Element* formattingElement)
     
    11901221            return;
    11911222        }
    1192         // FIXME: We need an iterator over m_openElements to implement this
    1193         // correctly.
    1194         notImplemented();
    1195         if (!m_openElements.inScope(token.name()))
    1196             return;
    1197         m_openElements.popUntil(token.name());
    1198         m_openElements.pop();
     1223        processAnyOtherEndTagForInBody(token);
    11991224        break;
    12001225    case AfterBodyMode:
  • trunk/WebCore/html/HTMLTreeBuilder.h

    r62469 r62498  
    124124    bool processStartTagForInHead(AtomicHTMLToken&);
    125125    bool processBodyEndTagForInBody(AtomicHTMLToken&);
     126    void processAnyOtherEndTagForInBody(AtomicHTMLToken&);
    126127    void processFakePEndTagIfPInScope();
    127128
Note: See TracChangeset for help on using the changeset viewer.