Changeset 62090 in webkit


Ignore:
Timestamp:
Jun 28, 2010 11:48:03 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-06-28 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

HTML5 tree builder shouldn't ASSERT on HTML5lib test suite
https://bugs.webkit.org/show_bug.cgi?id=41335

Sketch out the EndTag handling for InBodyMode.

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processEndTag):
  • html/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::ElementStack::inScope): (WebCore::HTMLTreeBuilder::clearActiveFormatingElementsUpToLastMarker): (WebCore::HTMLTreeBuilder::generateImpliedEndTags):

2010-06-28 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

HTML5 tree builder shouldn't ASSERT on HTML5lib test suite
https://bugs.webkit.org/show_bug.cgi?id=41335

Enable the remainder of the test suite and update expectations.

  • html5lib/webkit-runner-expected-html5.txt:
  • html5lib/webkit-runner-expected.txt:
  • html5lib/webkit-runner.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62088 r62090  
     12010-06-28  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        HTML5 tree builder shouldn't ASSERT on HTML5lib test suite
     6        https://bugs.webkit.org/show_bug.cgi?id=41335
     7
     8        Enable the remainder of the test suite and update expectations.
     9
     10        * html5lib/webkit-runner-expected-html5.txt:
     11        * html5lib/webkit-runner-expected.txt:
     12        * html5lib/webkit-runner.html:
     13
    1142010-06-28  Johnny Ding  <jnd@chromium.org>
    215
  • trunk/LayoutTests/html5lib/webkit-runner-expected-html5.txt

    r62076 r62090  
     1CONSOLE MESSAGE: line 1: SyntaxError: Parse error
    12CONSOLE MESSAGE: line 2: PASS
    23CONSOLE MESSAGE: line 2: FOO<span>BAR</span>BAZ
    34Content-Type: text/plain
     5resources/tests1.dat:
     62
     720
     821
     922
     1023
     1124
     1225
     1326
     1428
     1529
     1630
     1731
     1832
     1933
     2034
     2135
     2237
     2341
     2450
     2551
     2652
     2753
     2856
     2957
     3058
     3159
     3260
     3361
     3467
     3568
     3669
     3770
     3871
     3972
     4073
     4174
     4275
     4376
     4478
     4579
     4680
     4781
     4882
     4985
     5086
     5189
     5290
     5393
     5494
     5595
     5696
     5797
     5898
     5999
     60100
     61101
     62103
     63104
     64106
     65107
     66108
     67109
     68110
     69111
     70112
     71
    472resources/tests2.dat:
    5733
     
    218926
    229027
     9128
    239229
    249332
     
    289736
    299837
     9938
    3010040
    3110142
     
    3910953
    4011054
    41 55
    4211157
    4311258
     
    611307
    62131
     132resources/tests5.dat:
     1332
     1346
     1357
     1368
     1379
     13811
     139
    63140resources/tests6.dat:
    641411
    65 2
    661426
    671438
     
    1372139
    138214
     215resources/tests9.dat:
     2161
     2172
     2184
     2195
     2206
     2217
     2228
     2239
     22410
     22511
     22612
     22713
     22814
     22915
     23016
     23117
     23218
     23319
     23422
     23523
     23624
     23725
     238
     239resources/tests10.dat:
     2401
     2412
     2424
     2435
     2446
     2457
     2468
     2479
     24810
     24911
     25012
     25113
     25214
     25315
     25416
     25517
     25618
     25719
     25822
     25923
     26024
     26125
     262
    139263resources/tests11.dat:
    1402641
     
    1552793
    1562806
     281
     282resources/tests15.dat:
     2831
     2842
     2854
     2865
     2876
     2887
     2898
     2909
     29110
     29211
     29312
     29413
    157295
    158296resources/tests16.dat:
     
    208346
    209347resources/webkit01.dat:
    210 15
    21134817
    212349
  • trunk/LayoutTests/html5lib/webkit-runner-expected.txt

    r62076 r62090  
     1CONSOLE MESSAGE: line 1: SyntaxError: Parse error
    12CONSOLE MESSAGE: line 1: SyntaxError: Parse error
    23CONSOLE MESSAGE: line 2: PASS
    34CONSOLE MESSAGE: line 2: FOO<span>BAR</span>BAZ
     5resources/tests1.dat:
     625
     729
     830
     932
     1033
     1134
     1235
     1337
     1441
     1550
     1651
     1752
     1853
     1954
     2057
     2159
     2278
     2379
     2480
     2581
     2682
     2787
     2890
     2991
     3092
     3196
     3298
     33101
     34104
     35106
     36109
     37113
     38
    439resources/tests2.dat:
    5406
     
    38736
    39747
     75
     76resources/tests5.dat:
     772
     786
     797
     808
     819
     8216
    4083
    4184resources/tests6.dat:
     
    901339
    91134
     135resources/tests9.dat:
     1361
     1372
     1385
     1396
     1407
     1418
     1429
     14310
     14411
     14512
     14613
     14714
     14815
     14916
     15017
     15118
     15219
     15320
     15421
     15522
     15623
     15724
     15825
     159
     160resources/tests10.dat:
     1611
     1622
     1635
     1646
     1657
     1668
     1679
     16810
     16911
     17012
     17113
     17214
     17315
     17416
     17517
     17618
     17719
     17820
     17921
     18022
     18123
     18224
     18325
     184
    92185resources/tests11.dat:
    931861
     
    106199
    107200resources/tests14.dat: PASS
     201
     202resources/tests15.dat:
     2033
     2044
     2055
     2066
     2077
     20811
     20912
     21013
    108211
    109212resources/tests16.dat:
  • trunk/LayoutTests/html5lib/webkit-runner.html

    r62076 r62090  
    3939<script>
    4040var test_files = [
    41         // 'resources/tests1.dat',
     41        'resources/tests1.dat',
    4242        'resources/tests2.dat',
    4343        'resources/tests3.dat',
    4444        'resources/tests4.dat',
    45         // 'resources/tests5.dat',
     45        'resources/tests5.dat',
    4646        'resources/tests6.dat',
    4747        'resources/tests7.dat',
    4848        'resources/tests8.dat',
    49         // 'resources/tests9.dat',
    50         // 'resources/tests10.dat',
     49        'resources/tests9.dat',
     50        'resources/tests10.dat',
    5151        'resources/tests11.dat',
    5252        'resources/tests12.dat',
    5353        'resources/tests14.dat',
    54         // 'resources/tests15.dat',
     54        'resources/tests15.dat',
    5555        'resources/tests16.dat',
    5656        'resources/webkit01.dat',
  • trunk/WebCore/ChangeLog

    r62089 r62090  
     12010-06-28  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        HTML5 tree builder shouldn't ASSERT on HTML5lib test suite
     6        https://bugs.webkit.org/show_bug.cgi?id=41335
     7
     8        Sketch out the EndTag handling for InBodyMode.
     9
     10        * html/HTMLTreeBuilder.cpp:
     11        (WebCore::HTMLTreeBuilder::processEndTag):
     12        * html/HTMLTreeBuilder.h:
     13        (WebCore::HTMLTreeBuilder::ElementStack::inScope):
     14        (WebCore::HTMLTreeBuilder::clearActiveFormatingElementsUpToLastMarker):
     15        (WebCore::HTMLTreeBuilder::generateImpliedEndTags):
     16
    1172010-06-28  David Levin  <levin@chromium.org>
    218
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r62082 r62090  
    618618    case InBodyMode:
    619619        ASSERT(insertionMode() == InBodyMode);
    620         notImplemented();
    621         // FIXME: This implementation is a completely wrong but useful for testing.
     620        if (token.name() == bodyTag) {
     621            notImplemented();
     622            m_insertionMode = AfterBodyMode;
     623            return;
     624        }
     625        if (token.name() == htmlTag) {
     626            notImplemented();
     627            return;
     628        }
     629        if (token.name() == addressTag || token.name() == articleTag || token.name() == asideTag || token.name() == blockquoteTag || token.name() == buttonTag || token.name() == centerTag || token.name() == "details" || token.name() == dirTag || token.name() == divTag || token.name() == dlTag || token.name() == fieldsetTag || token.name() == "figure" || token.name() == footerTag || token.name() == headerTag || token.name() == hgroupTag || token.name() == listingTag || token.name() == menuTag || token.name() == navTag || token.name() == olTag || token.name() == preTag || token.name() == sectionTag || token.name() == ulTag) {
     630            if (!m_openElements.inScope(token.name())) {
     631                parseError(token);
     632                return;
     633            }
     634            generateImpliedEndTags();
     635            if (currentElement()->tagQName() != token.name())
     636                parseError(token);
     637            while (currentElement()->tagQName() != token.name())
     638                m_openElements.pop();
     639            m_openElements.pop();
     640        }
     641        if (token.name() == formTag) {
     642            RefPtr<Element> node = m_formElement.release();
     643            if (!node || !m_openElements.inScope(node.get())) {
     644                parseError(token);
     645                return;
     646            }
     647            generateImpliedEndTags();
     648            if (currentElement() != node.get())
     649                parseError(token);
     650            m_openElements.remove(node.get());
     651        }
     652        if (token.name() == pTag) {
     653            notImplemented();
     654            return;
     655        }
     656        if (token.name() == liTag) {
     657            notImplemented();
     658            return;
     659        }
     660        if (token.name() == ddTag || token.name() == dtTag) {
     661            notImplemented();
     662            return;
     663        }
     664        if (token.name() == h1Tag || token.name() == h2Tag || token.name() == h3Tag || token.name() == h4Tag || token.name() == h5Tag || token.name() == h6Tag) {
     665            notImplemented();
     666            return;
     667        }
     668        if (token.name() == "sarcasm") {
     669            notImplemented(); // Take a deep breath.
     670            return;
     671        }
     672        if (token.name() == aTag || token.name() == bTag || token.name() == bigTag || token.name() == codeTag || token.name() == emTag || token.name() == fontTag || token.name() == iTag || token.name() == nobrTag || token.name() == sTag || token.name() == smallTag || token.name() == strikeTag || token.name() == strongTag || token.name() == ttTag || token.name() == uTag) {
     673            notImplemented();
     674            // FIXME: There's a complicated algorithm that goes here.
     675            return;
     676        }
     677        if (token.name() == appletTag || token.name() == marqueeTag || token.name() == objectTag) {
     678            if (!m_openElements.inScope(token.name())) {
     679                parseError(token);
     680                return;
     681            }
     682            generateImpliedEndTags();
     683            if (currentElement()->tagQName() != token.name())
     684                parseError(token);
     685            while (currentElement()->tagQName() != token.name())
     686                m_openElements.pop();
     687            m_openElements.pop();
     688            // FIXME: m_activeFormattingElements should be more interesting
     689            // object than a vector so we can call this method on it instead
     690            // of on the tree builder.
     691            clearActiveFormatingElementsUpToLastMarker();
     692            return;
     693        }
     694        if (token.name() == brTag) {
     695            parseError(token);
     696            reconstructTheActiveFormattingElements();
     697            insertSelfClosingElement(token);
     698            m_framesetOk = false;
     699            return;
     700        }
     701        // FIXME: We need an iterator over m_openElements to implement this
     702        // correctly.
     703        notImplemented();
     704        if (!m_openElements.inScope(token.name()))
     705            return;
     706        while (currentElement()->tagQName() != token.name())
     707            m_openElements.pop();
    622708        m_openElements.pop();
    623709        break;
  • trunk/WebCore/html/HTMLTreeBuilder.h

    r62082 r62090  
    162162        }
    163163
     164        bool inScope(const AtomicString& name) const
     165        {
     166            // FIXME: This algorithm is wrong.
     167            for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) {
     168                if (pos->element()->tagQName() == name)
     169                    return true;
     170            }
     171            return false;
     172        }
     173
     174        bool inScope(Element* element) const
     175        {
     176            // FIXME: This algorithm is wrong.
     177            return contains(element);
     178        }
     179
    164180    private:
    165181        OwnPtr<ElementRecord> m_top;
     
    219235    bool indexOfFirstUnopenFormattingElement(unsigned& firstUnopenElementIndex) const;
    220236    void reconstructTheActiveFormattingElements();
     237    void clearActiveFormatingElementsUpToLastMarker() { }
     238
     239    void generateImpliedEndTags() { }
    221240
    222241    Element* currentElement() { return m_openElements.top(); }
Note: See TracChangeset for help on using the changeset viewer.