Changeset 62533 in webkit


Ignore:
Timestamp:
Jul 6, 2010 12:39:06 AM (14 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

Implement InCaptionMode
https://bugs.webkit.org/show_bug.cgi?id=41660

Implementing this mode also turned up a subtle bug in the adoption
agency code.

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption): (WebCore::HTMLTreeBuilder::processEndTag): (WebCore::HTMLTreeBuilder::processCharacter): (WebCore::HTMLTreeBuilder::indexOfFirstUnopenFormattingElement):
    • We're supposed to reutrn the first *unopened* formatting element. The old code returned the first *opened* formatting element.
  • html/HTMLTreeBuilder.h:

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

Reviewed by Eric Seidel.

Implement InCaptionMode
https://bugs.webkit.org/show_bug.cgi?id=41660

Massive test progression due to fixing Mr. Adoption Agency.

  • html5lib/runner-expected-html5.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62532 r62533  
     12010-07-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Implement InCaptionMode
     6        https://bugs.webkit.org/show_bug.cgi?id=41660
     7
     8        Massive test progression due to fixing Mr. Adoption Agency.
     9
     10        * html5lib/runner-expected-html5.txt:
     11
    1122010-07-06  Adam Barth  <abarth@webkit.org>
    213
  • trunk/LayoutTests/html5lib/runner-expected-html5.txt

    r62532 r62533  
    7721
    8823
    9 24
    10925
    111028
     
    161550
    171651
    18 53
    191756
    20 58
    21 59
    221860
    231961
    24 67
    25 68
    26 69
    27 70
    28 71
    292072
    302173
     
    352679
    362780
    37 81
    382882
    392986
     
    423294
    433396
    44 97
    453498
    4635100
     
    10998|         "X"
    11099|         <a>
    111 |           <a>
    112 |             "Y"
    113 |           "Z"
     100|           "Y"
     101|         "Z"
    114102Expected:
    115103| <html>
     
    123111|         "Y"
    124112|       "Z"
    125 
    126 Test 24 of 113 in resources/tests1.dat failed. Input:
    127 <b><button></b></button></b>
    128 Got:
    129 | <html>
    130 |   <head>
    131 |   <body>
    132 |     <b>
    133 |       <b>
    134 |         <button>
    135 Expected:
    136 | <html>
    137 |   <head>
    138 |   <body>
    139 |     <b>
    140 |       <button>
    141113
    142114Test 25 of 113 in resources/tests1.dat failed. Input:
     
    219191|       x=""
    220192|       "0"
    221 |       <a>
    222 |         <b>
    223 |           "1"
    224 |           <b>
    225 |             <a>
    226 |               y=""
    227 |               "2"
     193|       <b>
     194|         "1"
     195|         <a>
     196|           y=""
     197|           "2"
    228198Expected:
    229199| <html>
     
    251221|         "hello"
    252222|         <table>
    253 |           <font>
    254 |             <b>
     223|           "excite!"
     224|           <b>
     225|             "me!"
    255226|           <tbody>
    256227|             <tr>
     
    347318|       "TEST"
    348319
    349 Test 53 of 113 in resources/tests1.dat failed. Input:
    350 <b id=a><p><b id=b></p></b>TEST
    351 Got:
    352 | <html>
    353 |   <head>
    354 |   <body>
    355 |     <b>
    356 |       id="a"
    357 |       <p>
    358 |         <b>
    359 |           <b>
    360 |             id="b"
    361 |       "TEST"
    362 Expected:
    363 | <html>
    364 |   <head>
    365 |   <body>
    366 |     <b>
    367 |       id="a"
    368 |       <p>
    369 |         <b>
    370 |           id="b"
    371 |       "TEST"
    372 
    373320Test 56 of 113 in resources/tests1.dat failed. Input:
    374321<font><p>hello<b>cruel</font>world
     
    378325|   <body>
    379326|     <font>
    380 |       <p>
     327|     <p>
     328|       <font>
    381329|         "hello"
    382 |         <font>
    383 |           <b>
    384 |             "cruel"
    385 |         "world"
     330|         <b>
     331|           "cruelworld"
    386332Expected:
    387333| <html>
     
    397343|         "world"
    398344
    399 Test 58 of 113 in resources/tests1.dat failed. Input:
    400 <b>A<cite>B<div>C
    401 Got:
    402 | <html>
    403 |   <head>
    404 |   <body>
    405 |     <b>
    406 |       "A"
    407 |       <b>
    408 |         <cite>
    409 |           "B"
    410 |           <div>
    411 |             "C"
    412 Expected:
     345Test 60 of 113 in resources/tests1.dat failed. Input:
     346<b>A<cite>B<div>C</b>D
     347Got:
    413348| <html>
    414349|   <head>
     
    418353|       <cite>
    419354|         "B"
    420 |         <div>
    421 |           "C"
    422 
    423 Test 59 of 113 in resources/tests1.dat failed. Input:
    424 <b>A<cite>B<div>C</cite>D
    425 Got:
    426 | <html>
    427 |   <head>
    428 |   <body>
    429 |     <b>
    430 |       "A"
     355|     <div>
    431356|       <b>
    432 |         <cite>
    433 |           "B"
    434 |           <div>
    435 |             "CD"
    436 Expected:
    437 | <html>
    438 |   <head>
    439 |   <body>
    440 |     <b>
    441 |       "A"
    442 |       <cite>
    443 |         "B"
    444 |         <div>
    445 |           "CD"
    446 
    447 Test 60 of 113 in resources/tests1.dat failed. Input:
    448 <b>A<cite>B<div>C</b>D
    449 Got:
    450 | <html>
    451 |   <head>
    452 |   <body>
    453 |     <b>
    454 |       "A"
    455 |       <b>
    456 |         <cite>
    457 |           "B"
    458 |       <div>
    459 |         <b>
    460 |           "CD"
     357|         "CD"
    461358Expected:
    462359| <html>
     
    480377|     <cite>
    481378|       <b>
    482 |         <b>
    483 |           <cite>
    484 |             <b>
     379|         <cite>
     380|           <i>
     381|             <cite>
    485382|               <i>
    486 |                 <i>
    487 |                   <cite>
    488 |                     <i>
    489 |                       <i>
    490 |                         <i>
    491 |                           <cite>
    492 |                             <i>
    493 |                               <i>
    494 |             <i>
    495 |               <i>
    496 |                 <i>
    497 |                   <div>
    498 |                     <b>
    499 |                       "XTEST"
     383|                 <cite>
     384|                   <i>
     385|       <i>
     386|         <i>
     387|           <i>
     388|             <div>
     389|               <b>
     390|                 "XTEST"
    500391Expected:
    501392| <html>
     
    518409|               "TEST"
    519410
    520 Test 67 of 113 in resources/tests1.dat failed. Input:
    521 <DIV> abc <B> def <I>
    522 Got:
    523 | <html>
    524 |   <head>
    525 |   <body>
    526 |     <div>
    527 |       " abc "
    528 |       <b>
    529 |         " def "
    530 |         <b>
    531 |           <i>
    532 Expected:
    533 | <html>
    534 |   <head>
    535 |   <body>
    536 |     <div>
    537 |       " abc "
    538 |       <b>
    539 |         " def "
    540 |         <i>
    541 
    542 Test 68 of 113 in resources/tests1.dat failed. Input:
    543 <DIV> abc <B> def <I> ghi
    544 Got:
    545 | <html>
    546 |   <head>
    547 |   <body>
    548 |     <div>
    549 |       " abc "
    550 |       <b>
    551 |         " def "
    552 |         <b>
    553 |           <i>
    554 |             " ghi"
    555 Expected:
    556 | <html>
    557 |   <head>
    558 |   <body>
    559 |     <div>
    560 |       " abc "
    561 |       <b>
    562 |         " def "
    563 |         <i>
    564 |           " ghi"
    565 
    566 Test 69 of 113 in resources/tests1.dat failed. Input:
    567 <DIV> abc <B> def <I> ghi <P>
    568 Got:
    569 | <html>
    570 |   <head>
    571 |   <body>
    572 |     <div>
    573 |       " abc "
    574 |       <b>
    575 |         " def "
    576 |         <b>
    577 |           <i>
    578 |             " ghi "
    579 |             <p>
    580 Expected:
    581 | <html>
    582 |   <head>
    583 |   <body>
    584 |     <div>
    585 |       " abc "
    586 |       <b>
    587 |         " def "
    588 |         <i>
    589 |           " ghi "
    590 |           <p>
    591 
    592 Test 70 of 113 in resources/tests1.dat failed. Input:
    593 <DIV> abc <B> def <I> ghi <P> jkl
    594 Got:
    595 | <html>
    596 |   <head>
    597 |   <body>
    598 |     <div>
    599 |       " abc "
    600 |       <b>
    601 |         " def "
    602 |         <b>
    603 |           <i>
    604 |             " ghi "
    605 |             <p>
    606 |               " jkl"
    607 Expected:
    608 | <html>
    609 |   <head>
    610 |   <body>
    611 |     <div>
    612 |       " abc "
    613 |       <b>
    614 |         " def "
    615 |         <i>
    616 |           " ghi "
    617 |           <p>
    618 |             " jkl"
    619 
    620 Test 71 of 113 in resources/tests1.dat failed. Input:
    621 <DIV> abc <B> def <I> ghi <P> jkl </B>
    622 Got:
    623 | <html>
    624 |   <head>
    625 |   <body>
    626 |     <div>
    627 |       " abc "
    628 |       <b>
    629 |         " def "
    630 |         <b>
    631 |           <i>
    632 |             " ghi "
    633 |         <i>
    634 |           <p>
    635 |             <b>
    636 |               " jkl "
    637 Expected:
     411Test 72 of 113 in resources/tests1.dat failed. Input:
     412<DIV> abc <B> def <I> ghi <P> jkl </B> mno
     413Got:
    638414| <html>
    639415|   <head>
     
    648424|         <p>
    649425|           <b>
    650 |             " jkl "
    651 
    652 Test 72 of 113 in resources/tests1.dat failed. Input:
    653 <DIV> abc <B> def <I> ghi <P> jkl </B> mno
    654 Got:
    655 | <html>
    656 |   <head>
    657 |   <body>
    658 |     <div>
    659 |       " abc "
    660 |       <b>
    661 |         " def "
    662 |         <b>
    663 |           <i>
    664 |             " ghi "
    665 |         <i>
    666 |           <p>
    667 |             <b>
    668 |               " jkl  mno"
     426|             " jkl  mno"
    669427Expected:
    670428| <html>
     
    693451|       <b>
    694452|         " def "
    695 |         <b>
    696 |           <i>
    697 |             " ghi "
    698453|         <i>
    699 |         <p>
    700 |           <i>
    701 |             <b>
    702 |               " jkl  mno "
     454|           " ghi "
     455|       <i>
     456|       <p>
     457|         <i>
     458|           <b>
     459|             " jkl  mno "
    703460Expected:
    704461| <html>
     
    728485|       <b>
    729486|         " def "
    730 |         <b>
    731 |           <i>
    732 |             " ghi "
    733487|         <i>
    734 |         <p>
    735 |           <i>
    736 |             <b>
    737 |               " jkl  mno  pqr"
     488|           " ghi "
     489|       <i>
     490|       <p>
     491|         <i>
     492|           <b>
     493|             " jkl  mno  pqr"
    738494Expected:
    739495| <html>
     
    764520|       <b>
    765521|         " def "
    766 |         <b>
    767 |           <i>
    768 |             " ghi "
    769522|         <i>
    770 |         <p>
    771 |           <i>
    772 |             <b>
    773 |               " jkl  mno  pqr "
     523|           " ghi "
     524|       <i>
     525|       <p>
     526|         <i>
     527|           <b>
     528|             " jkl  mno  pqr "
    774529Expected:
    775530| <html>
     
    800555|       <b>
    801556|         " def "
    802 |         <b>
    803 |           <i>
    804 |             " ghi "
    805557|         <i>
    806 |         <p>
    807 |           <i>
    808 |             <b>
    809 |               " jkl  mno  pqr "
    810 |         " stu"
     558|           " ghi "
     559|       <i>
     560|       <p>
     561|         <i>
     562|           <b>
     563|             " jkl  mno  pqr "
     564|       " stu"
    811565Expected:
    812566| <html>
     
    839593|       <table>
    840594|         <a>
    841 |           <a>
    842 |             href="foo"
     595|           href="foo"
     596|           "br"
    843597|         <tbody>
    844598|           <tr>
     
    903657|       <a>
    904658|         href="blah"
     659|         "aba"
    905660|       <tbody>
    906661|         <tr>
     
    927682|       "aoe"
    928683
    929 Test 81 of 113 in resources/tests1.dat failed. Input:
    930 <a href=a>aa<marquee>aa<a href=b>bb</marquee>aa
    931 Got:
    932 | <html>
    933 |   <head>
    934 |   <body>
    935 |     <a>
    936 |       href="a"
    937 |       "aa"
    938 |       <a>
    939 |         <marquee>
    940 |           "aa"
    941 |           <a>
    942 |             <a>
    943 |               href="b"
    944 |               "bb"
    945 |         "aa"
    946 Expected:
    947 | <html>
    948 |   <head>
    949 |   <body>
    950 |     <a>
    951 |       href="a"
    952 |       "aa"
    953 |       <marquee>
    954 |         "aa"
    955 |         <a>
    956 |           href="b"
    957 |           "bb"
    958 |       "aa"
    959 
    960684Test 82 of 113 in resources/tests1.dat failed. Input:
    961685<wbr><strike><code></strike><code><strike></code>
     
    966690|     <wbr>
    967691|     <strike>
     692|       <code>
     693|     <code>
    968694|       <strike>
    969 |         <code>
    970 |       <code>
    971 |         <code>
    972 |           <strike>
    973695Expected:
    974696| <html>
     
    1016738|       <table>
    1017739|         <a>
    1018 |           <a>
    1019740|       <p>
    1020741|         <a>
     742|           <a>
    1021743|       <div>
    1022744|         <a>
     745|           <a>
     746|             <a>
    1023747Expected:
    1024748| <html>
     
    1086810|       <p>
    1087811|         <a>
    1088 |           <a>
    1089812Expected:
    1090813| <html>
     
    1095818|       <a>
    1096819|       <a>
    1097 
    1098 Test 97 of 113 in resources/tests1.dat failed. Input:
    1099 <b><button></b></button></b>
    1100 Got:
    1101 | <html>
    1102 |   <head>
    1103 |   <body>
    1104 |     <b>
    1105 |       <b>
    1106 |         <button>
    1107 Expected:
    1108 | <html>
    1109 |   <head>
    1110 |   <body>
    1111 |     <b>
    1112 |       <button>
    1113820
    1114821Test 98 of 113 in resources/tests1.dat failed. Input:
     
    1192899|                 <li>
    1193900|                   <b>
    1194 |                     <b>
    1195 |                       <em>
    1196 |                     <li>
     901|                     <em>
     902|                   <li>
    1197903Expected:
    1198904| <html>
     
    13591065resources/tests2.dat:
    136010664
    1361 8
    136210679
    1363106811
     
    1365107034
    1366107136
    1367 38
    1368107247
    1369107348
     
    13911095|             "test"
    13921096
    1393 Test 8 of 59 in resources/tests2.dat failed. Input:
    1394 <!DOCTYPE html><font><p><b>test</font>
    1395 Got:
    1396 | <!DOCTYPE html>
    1397 | <html>
    1398 |   <head>
    1399 |   <body>
    1400 |     <font>
    1401 |       <p>
    1402 |         <font>
    1403 |           <b>
    1404 |             "test"
    1405 Expected:
    1406 | <!DOCTYPE html>
    1407 | <html>
    1408 |   <head>
    1409 |   <body>
    1410 |     <font>
    1411 |     <p>
    1412 |       <font>
    1413 |         <b>
    1414 |           "test"
    1415 
    14161097Test 9 of 59 in resources/tests2.dat failed. Input:
    14171098<!DOCTYPE html><dt><div><dd>
     
    14411122|     <table>
    14421123|       <plaintext>
     1124|         "<td>"
    14431125Expected:
    14441126| <html>
     
    14781160|     <table>
    14791161|       <caption>
     1162|         "test TEST"
     1163|       <tbody>
     1164|         <tr>
     1165|           <td>
    14801166Expected:
    14811167| <!DOCTYPE html>
     
    15131199|       <option>
    15141200|     <option>
    1515 
    1516 Test 38 of 59 in resources/tests2.dat failed. Input:
    1517 <!DOCTYPE html><font><input><input></font>
    1518 Got:
    1519 | <!DOCTYPE html>
    1520 | <html>
    1521 |   <head>
    1522 |   <body>
    1523 |     <font>
    1524 |       <font>
    1525 |         <input>
    1526 |         <font>
    1527 |           <input>
    1528 Expected:
    1529 | <!DOCTYPE html>
    1530 | <html>
    1531 |   <head>
    1532 |   <body>
    1533 |     <font>
    1534 |       <input>
    1535 |       <input>
    15361201
    15371202Test 47 of 59 in resources/tests2.dat failed. Input:
     
    17131378|       <nobr>
    17141379|         <nobr>
    1715 |           <nobr>
    1716 |             <nobr>
    17171380Expected:
    17181381| <!DOCTYPE html>
     
    17331396|     <nobr>
    17341397|       <nobr>
    1735 |         <nobr>
    1736 |         <nobr>
    1737 |           <nobr>
     1398|       <nobr>
    17381399Expected:
    17391400| <!DOCTYPE html>
     
    1869153013
    1870153114
    1871 16
    1872 17
    1873 19
    1874 23
    1875153226
    1876153327
     
    20011658|     <button>
    20021659
    2003 Test 16 of 51 in resources/tests6.dat failed. Input:
    2004 <table><caption><td>
    2005 Got:
    2006 | <html>
    2007 |   <head>
    2008 |   <body>
    2009 |     <table>
    2010 |       <caption>
    2011 Expected:
    2012 | <html>
    2013 |   <head>
    2014 |   <body>
    2015 |     <table>
    2016 |       <caption>
    2017 |       <tbody>
    2018 |         <tr>
    2019 |           <td>
    2020 
    2021 Test 17 of 51 in resources/tests6.dat failed. Input:
    2022 <table><caption><div>
    2023 Got:
    2024 | <html>
    2025 |   <head>
    2026 |   <body>
    2027 |     <table>
    2028 |       <caption>
    2029 Expected:
    2030 | <html>
    2031 |   <head>
    2032 |   <body>
    2033 |     <table>
    2034 |       <caption>
    2035 |         <div>
    2036 
    2037 Test 19 of 51 in resources/tests6.dat failed. Input:
    2038 <table><caption><div></caption>
    2039 Got:
    2040 | <html>
    2041 |   <head>
    2042 |   <body>
    2043 |     <table>
    2044 |       <caption>
    2045 Expected:
    2046 | <html>
    2047 |   <head>
    2048 |   <body>
    2049 |     <table>
    2050 |       <caption>
    2051 |         <div>
    2052 
    2053 Test 23 of 51 in resources/tests6.dat failed. Input:
    2054 <table><caption><div></div>
    2055 Got:
    2056 | <html>
    2057 |   <head>
    2058 |   <body>
    2059 |     <table>
    2060 |       <caption>
    2061 Expected:
    2062 | <html>
    2063 |   <head>
    2064 |   <body>
    2065 |     <table>
    2066 |       <caption>
    2067 |         <div>
    2068 
    20691660Test 26 of 51 in resources/tests6.dat failed. Input:
    20701661<table><colgroup>foo
     
    220717987
    220817998
    2209 9
    2210180010
    2211180115
     
    22661856|   <body>
    22671857|     <table>
     1858|       "X"
    22681859|       <tbody>
    22691860|         <tr>
     
    23111902|   <body>
    23121903
    2313 Test 9 of 30 in resources/tests7.dat failed. Input:
    2314 <!doctype html><table><style> <tr>x </style> </table>
    2315 Got:
    2316 | <!DOCTYPE html>
    2317 | <html>
    2318 |   <head>
    2319 |   <body>
    2320 |     <table>
    2321 |       <style>
    2322 |         " <tr>x "
    2323 Expected:
    2324 | <!DOCTYPE html>
    2325 | <html>
    2326 |   <head>
    2327 |   <body>
    2328 |     <table>
    2329 |       <style>
    2330 |         " <tr>x "
    2331 |       " "
    2332 
    23331904Test 10 of 30 in resources/tests7.dat failed. Input:
    23341905<!doctype html><table><TBODY><script> <tr>x </script> </table>
     
    23771948|   <body>
    23781949|     <table>
     1950|       "X"
    23791951Expected:
    23801952| <!DOCTYPE html>
     
    23951967|   <body>
    23961968|     <table>
     1969|       "  "
    23971970Expected:
    23981971| <!DOCTYPE html>
     
    24131986|   <body>
    24141987|     <table>
     1988|       "  "
    24151989Expected:
    24161990| <!DOCTYPE html>
     
    26842258|     <table>
    26852259|       <div>
     2260|         "x"
    26862261|         <div>
     2262|       "xx"
    26872263Expected:
    26882264| <html>
     
    27032279|     "x"
    27042280|     <table>
     2281|       "x"
    27052282Expected:
    27062283| <html>
     
    27182295|     "x"
    27192296|     <table>
     2297|       "x"
    27202298Expected:
    27212299| <html>
     
    28492427|       <math>
    28502428|         <mi>
     2429|           "foo"
    28512430Expected:
    28522431| <!DOCTYPE html>
     
    28692448|       <math>
    28702449|         <mi>
     2450|           "foo"
    28712451|         <mi>
     2452|           "bar"
    28722453Expected:
    28732454| <!DOCTYPE html>
     
    29912572|     <table>
    29922573|       <caption>
     2574|         <math>
     2575|           <mi>
     2576|             "foo"
     2577|           <mi>
     2578|             "bar"
     2579|         <p>
     2580|           "baz"
    29932581Expected:
    29942582| <!DOCTYPE html>
     
    30152603|     <table>
    30162604|       <caption>
     2605|         <math>
     2606|           <mi>
     2607|             "foo"
     2608|           <mi>
     2609|             "bar"
     2610|           <p>
     2611|             "baz"
     2612|     <p>
     2613|       "quux"
    30172614Expected:
    30182615| <!DOCTYPE html>
     
    30412638|     <table>
    30422639|       <caption>
     2640|         <math>
     2641|           <mi>
     2642|             "foo"
     2643|           <mi>
     2644|             "bar"
     2645|           "baz"
     2646|     <p>
     2647|       "quux"
    30432648Expected:
    30442649| <!DOCTYPE html>
     
    33602965|       <svg>
    33612966|         <g>
     2967|           "foo"
    33622968Expected:
    33632969| <!DOCTYPE html>
     
    33802986|       <svg>
    33812987|         <g>
     2988|           "foo"
    33822989|         <g>
     2990|           "bar"
    33832991Expected:
    33842992| <!DOCTYPE html>
     
    35023110|     <table>
    35033111|       <caption>
     3112|         <svg>
     3113|           <g>
     3114|             "foo"
     3115|           <g>
     3116|             "bar"
     3117|         <p>
     3118|           "baz"
    35043119Expected:
    35053120| <!DOCTYPE html>
     
    35263141|     <table>
    35273142|       <caption>
     3143|         <svg>
     3144|           <g>
     3145|             "foo"
     3146|           <g>
     3147|             "bar"
     3148|           <p>
     3149|             "baz"
     3150|     <p>
     3151|       "quux"
    35283152Expected:
    35293153| <!DOCTYPE html>
     
    35523176|     <table>
    35533177|       <caption>
     3178|         <svg>
     3179|           <g>
     3180|             "foo"
     3181|           <g>
     3182|             "bar"
     3183|           "baz"
     3184|     <p>
     3185|       "quux"
    35543186Expected:
    35553187| <!DOCTYPE html>
     
    48554487|     <p>
    48564488|       <b>
    4857 |         <b>
    4858 |           <i>
    4859 |             <i>
    4860 |               <u>
     4489|         <i>
     4490|           <u>
    48614491|     " "
    48624492|     <p>
     
    48874517|     <p>
    48884518|       <b>
    4889 |         <b>
    4890 |           <i>
    4891 |             <i>
    4892 |               <u>
     4519|         <i>
     4520|           <u>
    48934521|     "
    48944522"
     
    49324560|   <body>
    49334561|     <table>
     4562|       " X"
    49344563|       <meta>
    49354564Expected:
     
    49504579|   <body>
    49514580|     <table>
     4581|       " x"
    49524582Expected:
    49534583| <!DOCTYPE html>
     
    49664596|   <body>
    49674597|     <table>
     4598|       " x "
    49684599Expected:
    49694600| <!DOCTYPE html>
     
    50024633|   <body>
    50034634|     <table>
    5004 |       <style>
    5005 |         " <tr>x "
    5006 Expected:
    5007 | <!DOCTYPE html>
    5008 | <html>
    5009 |   <head>
    5010 |   <body>
    5011 |     "X"
    5012 |     <table>
     4635|       "X"
    50134636|       <style>
    50144637|         " <tr>x "
    50154638|       " "
     4639Expected:
     4640| <!DOCTYPE html>
     4641| <html>
     4642|   <head>
     4643|   <body>
     4644|     "X"
     4645|     <table>
     4646|       <style>
     4647|         " <tr>x "
     4648|       " "
    50164649
    50174650Test 12 of 14 in resources/tests15.dat failed. Input:
     
    50254658|       <table>
    50264659|         <a>
     4660|           "foo"
     4661|         " "
    50274662|         <tbody>
    50284663|           <tr>
     
    50444679|             " "
    50454680resources/tests16.dat:
    5046 187
    50474681188
    5048 
    5049 Test 187 of 189 in resources/tests16.dat failed. Input:
    5050 <!doctype html><table>
    5051 
    5052 Got:
    5053 | <!DOCTYPE html>
    5054 | <html>
    5055 |   <head>
    5056 |   <body>
    5057 |     <table>
    5058 Expected:
    5059 | <!DOCTYPE html>
    5060 | <html>
    5061 |   <head>
    5062 |   <body>
    5063 |     <table>
    5064 |       "
    5065 "
    50664682
    50674683Test 188 of 189 in resources/tests16.dat failed. Input:
     
    51654781|     <a>
    51664782|       "1"
    5167 |       <a>
    5168 |         <button>
    5169 |           "23"
     4783|       <button>
     4784|         "23"
    51704785Expected:
    51714786| <html>
     
    51864801|     <a>
    51874802|       "1"
    5188 |       <a>
    5189 |         <b>
    5190 |           "2"
    5191 |       "3"
     4803|       <b>
     4804|         "2"
     4805|     "3"
    51924806Expected:
    51934807| <html>
     
    52384852|     <p>
    52394853|       <a>
     4854|         "23"
    52404855|     <table>
    52414856|       <a>
     4857|         "1"
    52424858Expected:
    52434859| <html>
  • trunk/WebCore/ChangeLog

    r62532 r62533  
     12010-07-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Implement InCaptionMode
     6        https://bugs.webkit.org/show_bug.cgi?id=41660
     7
     8        Implementing this mode also turned up a subtle bug in the adoption
     9        agency code.
     10
     11        * html/HTMLTreeBuilder.cpp:
     12        (WebCore::HTMLTreeBuilder::processStartTag):
     13        (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
     14        (WebCore::HTMLTreeBuilder::processEndTag):
     15        (WebCore::HTMLTreeBuilder::processCharacter):
     16        (WebCore::HTMLTreeBuilder::indexOfFirstUnopenFormattingElement):
     17            - We're supposed to reutrn the first *unopened* formatting element.
     18              The old code returned the first *opened* formatting element.
     19        * html/HTMLTreeBuilder.h:
     20
    1212010-07-06  Adam Barth  <abarth@webkit.org>
    222
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r62532 r62533  
    866866        processStartTagForInBody(token);
    867867        break;
     868    case InCaptionMode:
     869        ASSERT(insertionMode() == InCaptionMode);
     870        if (token.name() == captionTag || token.name() == colTag || token.name() == colgroupTag || token.name() == tbodyTag || token.name() == tdTag || token.name() == tfootTag || token.name() == thTag || token.name() == theadTag || token.name() == trTag) {
     871            parseError(token);
     872            if (!processCaptionEndTagForInCaption()) {
     873                ASSERT(m_isParsingFragment);
     874                return;
     875            }
     876            processStartTag(token);
     877            return;
     878        }
     879        processStartTagForInBody(token);
     880        break;
    868881    case InColumnGroupMode:
     882        ASSERT(insertionMode() == InColumnGroupMode);
    869883        if (token.name() == htmlTag) {
    870884            insertHTMLStartTagInBody(token);
     
    14181432}
    14191433
     1434bool HTMLTreeBuilder::processCaptionEndTagForInCaption()
     1435{
     1436    if (!m_openElements.inTableScope(captionTag.localName())) {
     1437        ASSERT(m_isParsingFragment);
     1438        // FIXME: parse error
     1439        return false;
     1440    }
     1441    generateImpliedEndTags();
     1442    // FIXME: parse error if (!currentElement()->hasTagName(captionTag))
     1443    m_openElements.popUntil(captionTag.localName());
     1444    m_openElements.pop();
     1445    m_activeFormattingElements.clearToLastMarker();
     1446    m_insertionMode = InTableMode;
     1447    return true;
     1448}
     1449
    14201450void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
    14211451{
     
    14871517        processEndTagForInBody(token);
    14881518        break;
     1519    case InCaptionMode:
     1520        ASSERT(insertionMode() == InCaptionMode);
     1521        if (token.name() == captionTag) {
     1522            processCaptionEndTagForInCaption();
     1523            return;
     1524        }
     1525        if (token.name() == tableTag) {
     1526            parseError(token);
     1527            if (!processCaptionEndTagForInCaption()) {
     1528                ASSERT(m_isParsingFragment);
     1529                return;
     1530            }
     1531            processEndTag(token);
     1532            return;
     1533        }
     1534        if (token.name() == bodyTag || token.name() == colTag || token.name() == colgroupTag || token.name() == htmlTag || token.name() == tbodyTag || token.name() == tdTag || token.name() == tfootTag || token.name() == thTag || token.name() == theadTag || token.name() == trTag) {
     1535            parseError(token);
     1536            return;
     1537        }
     1538        processEndTagForInBody(token);
     1539        break;
    14891540    case AfterBodyMode:
    14901541        ASSERT(insertionMode() == AfterBodyMode);
     
    16471698        // Fall through
    16481699    case InBodyMode:
    1649         ASSERT(insertionMode() == InBodyMode);
     1700    case InTableMode:
     1701    case InCaptionMode:
     1702        ASSERT(insertionMode() == InBodyMode || insertionMode() == InTableMode || insertionMode() == InCaptionMode);
    16501703        notImplemented();
    16511704        insertTextNode(token);
     
    19502003        const HTMLFormattingElementList::Entry& entry = m_activeFormattingElements[index];
    19512004        if (entry.isMarker() || m_openElements.contains(entry.element())) {
    1952             firstUnopenElementIndex = index;
    1953             return true;
     2005            firstUnopenElementIndex = index + 1;
     2006            return firstUnopenElementIndex < m_activeFormattingElements.size();
    19542007        }
    19552008    } while (index);
  • trunk/WebCore/html/HTMLTreeBuilder.h

    r62532 r62533  
    128128    void processIsindexStartTagForBody(AtomicHTMLToken&);
    129129    bool processBodyEndTagForInBody(AtomicHTMLToken&);
     130    bool processCaptionEndTagForInCaption();
    130131    void processAnyOtherEndTagForInBody(AtomicHTMLToken&);
    131132
Note: See TracChangeset for help on using the changeset viewer.