Changeset 63264 in webkit


Ignore:
Timestamp:
Jul 13, 2010 5:18:52 PM (14 years ago)
Author:
eric@webkit.org
Message:

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

Reviewed by Adam Barth.

Make our end tag in-foreign-content mode spec bug workarounds more closely match minefield
https://bugs.webkit.org/show_bug.cgi?id=42187

  • html5lib/runner-expected-html5.txt:

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

Reviewed by Adam Barth.

Make our end tag in-foreign-content mode spec bug workarounds more closely match minefield
https://bugs.webkit.org/show_bug.cgi?id=42187

I do not expect these work-arounds to be permanent. Hixie has promised to
addresses the feedback to the parser sections of HTML5 soon.
I added these hacks to make our hacks more-closely match Minefield's hacks
and thus have us "pass" a few more html5lib runner tests.

We now pass all of the html5lib foreign content tests
(thus we'll likely need to write more).

Tested by html5lib/runner.html

  • html/HTMLElementStack.cpp: (WebCore::HTMLElementStack::contains):
  • html/HTMLElementStack.h:
  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processEndTag):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63261 r63264  
     12010-07-13  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Make our end tag in-foreign-content mode spec bug workarounds more closely match minefield
     6        https://bugs.webkit.org/show_bug.cgi?id=42187
     7
     8        * html5lib/runner-expected-html5.txt:
     9
    1102010-07-13  Brian Weinstein  <bweinstein@apple.com>
    211
  • trunk/LayoutTests/html5lib/runner-expected-html5.txt

    r63168 r63264  
    336336resources/tests8.dat: PASS
    337337
    338 resources/tests9.dat:
    339 14
    340 
    341 Test 14 of 25 in resources/tests9.dat failed. Input:
    342 <!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux
    343 Got:
    344 | <!DOCTYPE html>
    345 | <html>
    346 |   <head>
    347 |   <body>
    348 |     <table>
    349 |       <caption>
    350 |         <math math>
    351 |           <math mi>
    352 |             "foo"
    353 |           <math mi>
    354 |             "bar"
    355 |           "baz"
    356 |         <p>
    357 |           "quux"
    358 Expected:
    359 | <!DOCTYPE html>
    360 | <html>
    361 |   <head>
    362 |   <body>
    363 |     <table>
    364 |       <caption>
    365 |         <math math>
    366 |           <math mi>
    367 |             "foo"
    368 |           <math mi>
    369 |             "bar"
    370 |           "baz"
    371 |     <p>
    372 |       "quux"
    373 resources/tests10.dat:
    374 14
    375 
    376 Test 14 of 25 in resources/tests10.dat failed. Input:
    377 <!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux
    378 Got:
    379 | <!DOCTYPE html>
    380 | <html>
    381 |   <head>
    382 |   <body>
    383 |     <table>
    384 |       <caption>
    385 |         <svg svg>
    386 |           <svg g>
    387 |             "foo"
    388 |           <svg g>
    389 |             "bar"
    390 |           "baz"
    391 |         <p>
    392 |           "quux"
    393 Expected:
    394 | <!DOCTYPE html>
    395 | <html>
    396 |   <head>
    397 |   <body>
    398 |     <table>
    399 |       <caption>
    400 |         <svg svg>
    401 |           <svg g>
    402 |             "foo"
    403 |           <svg g>
    404 |             "bar"
    405 |           "baz"
    406 |     <p>
    407 |       "quux"
     338resources/tests9.dat: PASS
     339
     340resources/tests10.dat: PASS
     341
    408342resources/tests11.dat: PASS
    409343
    410 resources/tests12.dat:
    411 1
    412 2
    413 
    414 Test 1 of 2 in resources/tests12.dat failed. Input:
    415 <!DOCTYPE html><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar
    416 Got:
    417 | <!DOCTYPE html>
    418 | <html>
    419 |   <head>
    420 |   <body>
    421 |     <p>
    422 |       "foo"
    423 |       <math math>
    424 |         <math mtext>
    425 |           <i>
    426 |             "baz"
    427 |         <math annotation-xml>
    428 |           <svg svg>
    429 |             <svg desc>
    430 |               <b>
    431 |                 "eggs"
    432 |             <svg g>
    433 |               <svg foreignObject>
    434 |                 <p>
    435 |                   "spam"
    436 |                 <table>
    437 |                   <tbody>
    438 |                     <tr>
    439 |                       <td>
    440 |                         <img>
    441 |                 <g>
    442 |                   "quux"
    443 |                 "bar"
    444 Expected:
    445 | <!DOCTYPE html>
    446 | <html>
    447 |   <head>
    448 |   <body>
    449 |     <p>
    450 |       "foo"
    451 |       <math math>
    452 |         <math mtext>
    453 |           <i>
    454 |             "baz"
    455 |         <math annotation-xml>
    456 |           <svg svg>
    457 |             <svg desc>
    458 |               <b>
    459 |                 "eggs"
    460 |             <svg g>
    461 |               <svg foreignObject>
    462 |                 <p>
    463 |                   "spam"
    464 |                 <table>
    465 |                   <tbody>
    466 |                     <tr>
    467 |                       <td>
    468 |                         <img>
    469 |             <svg g>
    470 |               "quux"
    471 |       "bar"
    472 
    473 Test 2 of 2 in resources/tests12.dat failed. Input:
    474 <!DOCTYPE html><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar
    475 Got:
    476 | <!DOCTYPE html>
    477 | <html>
    478 |   <head>
    479 |   <body>
    480 |     "foo"
    481 |     <math math>
    482 |       <math mtext>
    483 |         <i>
    484 |           "baz"
    485 |       <math annotation-xml>
    486 |         <svg svg>
    487 |           <svg desc>
    488 |             <b>
    489 |               "eggs"
    490 |           <svg g>
    491 |             <svg foreignObject>
    492 |               <p>
    493 |                 "spam"
    494 |               <table>
    495 |                 <tbody>
    496 |                   <tr>
    497 |                     <td>
    498 |                       <img>
    499 |               <g>
    500 |                 "quux"
    501 |               "bar"
    502 Expected:
    503 | <!DOCTYPE html>
    504 | <html>
    505 |   <head>
    506 |   <body>
    507 |     "foo"
    508 |     <math math>
    509 |       <math mtext>
    510 |         <i>
    511 |           "baz"
    512 |       <math annotation-xml>
    513 |         <svg svg>
    514 |           <svg desc>
    515 |             <b>
    516 |               "eggs"
    517 |           <svg g>
    518 |             <svg foreignObject>
    519 |               <p>
    520 |                 "spam"
    521 |               <table>
    522 |                 <tbody>
    523 |                   <tr>
    524 |                     <td>
    525 |                       <img>
    526 |           <svg g>
    527 |             "quux"
    528 |     "bar"
     344resources/tests12.dat: PASS
     345
    529346resources/tests14.dat: PASS
    530347
  • trunk/WebCore/ChangeLog

    r63259 r63264  
     12010-07-13  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Make our end tag in-foreign-content mode spec bug workarounds more closely match minefield
     6        https://bugs.webkit.org/show_bug.cgi?id=42187
     7
     8        I do not expect these work-arounds to be permanent.  Hixie has promised to
     9        addresses the feedback to the parser sections of HTML5 soon.
     10        I added these hacks to make our hacks more-closely match Minefield's hacks
     11        and thus have us "pass" a few more html5lib runner tests.
     12
     13        We now pass all of the html5lib foreign content tests
     14        (thus we'll likely need to write more).
     15
     16        Tested by html5lib/runner.html
     17
     18        * html/HTMLElementStack.cpp:
     19        (WebCore::HTMLElementStack::contains):
     20        * html/HTMLElementStack.h:
     21        * html/HTMLTreeBuilder.cpp:
     22        (WebCore::HTMLTreeBuilder::processEndTag):
     23
    1242010-07-12  Tony Gentilcore  <tonyg@chromium.org>
    225
  • trunk/WebCore/html/HTMLElementStack.cpp

    r63135 r63264  
    326326}
    327327
     328bool HTMLElementStack::contains(const AtomicString& tagName) const
     329{
     330    return !!topmost(tagName);
     331}
     332
    328333template <bool isMarker(Element*)>
    329334bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& targetTag)
  • trunk/WebCore/html/HTMLElementStack.h

    r63135 r63264  
    9898
    9999    bool contains(Element*) const;
     100    bool contains(const AtomicString& tagName) const;
    100101
    101102    bool inScope(Element*) const;
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r63183 r63264  
    23412341            if (!nodeRecord->element()->hasLocalName(token.name())) {
    23422342                parseError(token);
    2343                 // FIXME: This return is not in the spec but appears to be needed.
     2343                // FIXME: This return is not in the spec but it needed for now
     2344                // to prevent walking off the bottom of the stack.
    23442345                // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10118
    2345                 return;
     2346                if (!m_tree.openElements()->contains(token.name()))
     2347                    return;
    23462348            }
    23472349            while (1) {
     
    23512353                }
    23522354                nodeRecord = nodeRecord->next();
    2353                 if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI)
     2355                if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) {
    23542356                    processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
     2357                    // FIXME: This is a hack around a spec bug and is likely wrong.
     2358                    // http://www.w3.org/Bugs/Public/show_bug.cgi?id=9581
     2359                    if (nodeRecord != m_tree.openElements()->topRecord())
     2360                        return;
     2361                }
    23552362            }
    23562363            return;
Note: See TracChangeset for help on using the changeset viewer.