Changeset 62375 in webkit


Ignore:
Timestamp:
Jul 2, 2010 3:14:14 AM (14 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

Implement AfterAfterBodyMode
https://bugs.webkit.org/show_bug.cgi?id=41501

The AfterAfterBodyMode doesn't seem to be well-covered by the existing
HTML5lib tests, so I added a few more tests to cover it. It's somewhat
hard to observe. The only way I can figure out to observe it is where
the comment elements get attached to the DOM.

  • html5lib/resources/webkit01.dat:
  • html5lib/runner-expected-html5.txt:
  • html5lib/runner-expected.txt:
  • html5lib/webkit-resumer-expected.txt:

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

Reviewed by Eric Seidel.

Implement AfterAfterBodyMode
https://bugs.webkit.org/show_bug.cgi?id=41501

In implementing this mode, I noticed a bug in the character processing
of the AfterBodyMode, which I fixed by adding a break statement. Also,
to get one of the new tests to pass, I needed to implement one
notImplemented() in the InBody insertion mode. Yay for testing.

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processEndTag): (WebCore::HTMLTreeBuilder::processComment): (WebCore::HTMLTreeBuilder::processCharacter): (WebCore::HTMLTreeBuilder::processEndOfFile):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62373 r62375  
     12010-07-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Implement AfterAfterBodyMode
     6        https://bugs.webkit.org/show_bug.cgi?id=41501
     7
     8        The AfterAfterBodyMode doesn't seem to be well-covered by the existing
     9        HTML5lib tests, so I added a few more tests to cover it.  It's somewhat
     10        hard to observe.  The only way I can figure out to observe it is where
     11        the comment elements get attached to the DOM.
     12
     13        * html5lib/resources/webkit01.dat:
     14        * html5lib/runner-expected-html5.txt:
     15        * html5lib/runner-expected.txt:
     16        * html5lib/webkit-resumer-expected.txt:
     17
    1182010-07-02  Yury Semikhatsky  <yurys@chromium.org>
    219
  • trunk/LayoutTests/html5lib/resources/webkit01.dat

    r62370 r62375  
    269269|       <br>
    270270|         foo="bar"
     271
     272#data
     273<html><body></body></html><!-- Hi there -->
     274#errors
     275#document
     276| <html>
     277|   <head>
     278|   <body>
     279| <!--  Hi there  -->
     280
     281#data
     282<html><body></body></html>x<!-- Hi there -->
     283#errors
     284#document
     285| <html>
     286|   <head>
     287|   <body>
     288|     "x"
     289|     <!--  Hi there  -->
     290
     291#data
     292<html><body></body></html>x<!-- Hi there --></html><!-- Again -->
     293#errors
     294#document
     295| <html>
     296|   <head>
     297|   <body>
     298|     "x"
     299|     <!--  Hi there  -->
     300| <!--  Again  -->
     301
     302#data
     303<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
     304#errors
     305#document
     306| <html>
     307|   <head>
     308|   <body>
     309|     "x"
     310|     <!--  Hi there  -->
     311| <!--  Again  -->
  • trunk/LayoutTests/html5lib/runner-expected-html5.txt

    r62370 r62375  
    17281728|     "X"
    17291729|     "X"
    1730 |     "X"
    17311730Expected:
    17321731| <!DOCTYPE html>
     
    19321931|     "X"
    19331932|     "X"
    1934 |     "X"
    19351933Expected:
    19361934| <!DOCTYPE html>
     
    19481946|   <body>
    19491947|     "X"
    1950 |     " "
    19511948|     " "
    19521949Expected:
     
    37413738|   <head>
    37423739|   <body>
     3740|     <math>
     3741|       <mi>
     3742|         "foo"
     3743|       <mi>
     3744|         "bar"
     3745|       <p>
     3746|         "baz"
    37433747Expected:
    37443748| <!DOCTYPE html>
     
    42364240|   <head>
    42374241|   <body>
     4242|     <svg>
     4243|       <g>
     4244|         "foo"
     4245|       <g>
     4246|         "bar"
     4247|       <p>
     4248|         "baz"
    42384249Expected:
    42394250| <!DOCTYPE html>
     
    5692570317
    56935704
    5694 Test 17 of 23 in resources/webkit01.dat failed. Input:
     5705Test 17 of 27 in resources/webkit01.dat failed. Input:
    56955706<A>test< /A>
    56965707Got:
  • trunk/LayoutTests/html5lib/runner-expected.txt

    r62370 r62375  
    4690469020
    4691469122
    4692 
    4693 Test 17 of 23 in resources/webkit01.dat failed. Input:
     469224
     469326
     469427
     4695
     4696Test 17 of 27 in resources/webkit01.dat failed. Input:
    46944697<A>test< /A>
    46954698Got:
     
    47074710|       "test< /A>"
    47084711
    4709 Test 20 of 23 in resources/webkit01.dat failed. Input:
     4712Test 20 of 27 in resources/webkit01.dat failed. Input:
    47104713<body></br foo="bar"></body>
    47114714Got:
     
    47214724|     <br>
    47224725
    4723 Test 22 of 23 in resources/webkit01.dat failed. Input:
     4726Test 22 of 27 in resources/webkit01.dat failed. Input:
    47244727<body></body></br foo="bar">
    47254728Got:
     
    47344737|   <body>
    47354738|     <br>
     4739
     4740Test 24 of 27 in resources/webkit01.dat failed. Input:
     4741<html><body></body></html><!-- Hi there -->
     4742Got:
     4743| <html>
     4744|   <head>
     4745|   <body>
     4746|     <!--  Hi there  -->
     4747Expected:
     4748| <html>
     4749|   <head>
     4750|   <body>
     4751| <!--  Hi there  -->
     4752
     4753Test 26 of 27 in resources/webkit01.dat failed. Input:
     4754<html><body></body></html>x<!-- Hi there --></html><!-- Again -->
     4755Got:
     4756| <html>
     4757|   <head>
     4758|   <body>
     4759|     "x"
     4760|     <!--  Hi there  -->
     4761|     <!--  Again  -->
     4762Expected:
     4763| <html>
     4764|   <head>
     4765|   <body>
     4766|     "x"
     4767|     <!--  Hi there  -->
     4768| <!--  Again  -->
     4769
     4770Test 27 of 27 in resources/webkit01.dat failed. Input:
     4771<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
     4772Got:
     4773| <html>
     4774|   <head>
     4775|   <body>
     4776|     "x"
     4777|     <!--  Hi there  -->
     4778|     <!--  Again  -->
     4779Expected:
     4780| <html>
     4781|   <head>
     4782|   <body>
     4783|     "x"
     4784|     <!--  Hi there  -->
     4785| <!--  Again  -->
    47364786resources/doctype01.dat: PASS
    47374787
  • trunk/LayoutTests/html5lib/webkit-resumer-expected.txt

    r62370 r62375  
    223223725.26
    224224726.27
     225752.1
     226753.2
     227754.3
     228755.4
     229756.5
     230757.6
     231758.7
     232759.8
     233760.9
     234761.10
     235762.11
     236763.12
     237764.13
     238765.14
     239766.15
     240767.16
     241768.17
     242769.18
     243770.19
     244771.20
     245772.21
     246773.22
     247774.23
     248775.24
     249776.25
     250777.26
     251778.27
     252779.28
     253780.29
     254781.30
     255782.31
     256783.32
     257784.33
     258785.34
     259786.35
     260787.36
     261788.37
     262789.38
     263790.39
     264791.40
     265792.41
     266793.42
     267837.1
     268838.2
     269839.3
     270840.4
     271841.5
     272842.6
     273843.7
     274844.8
     275845.9
     276846.10
     277847.11
     278848.12
     279849.13
     280850.14
     281851.15
     282852.16
     283853.17
     284854.18
     285855.19
     286856.20
     287857.21
     288858.22
     289859.23
     290860.24
     291861.25
     292862.26
     293863.27
     294864.28
     295865.29
     296866.30
     297867.31
     298868.32
     299869.33
     300870.34
     301871.35
     302872.36
     303873.37
     304874.38
     305875.39
     306876.40
     307877.41
     308878.42
     309879.43
     310880.44
     311881.45
     312882.46
     313883.47
     314884.48
     315885.49
     316886.50
     317887.51
     318888.52
     319889.53
     320890.54
     321891.55
     322892.56
     323893.57
     324894.58
     325895.59
     326896.60
     327897.61
     328898.62
     329899.63
     330900.64
     331901.1
     332902.2
     333903.3
     334904.4
     335905.5
     336906.6
     337907.7
     338908.8
     339909.9
     340910.10
     341911.11
     342912.12
     343913.13
     344914.14
     345915.15
     346916.16
     347917.17
     348918.18
     349919.19
     350920.20
     351921.21
     352922.22
     353923.23
     354924.24
     355925.25
     356926.26
     357927.27
     358928.28
     359929.29
     360930.30
     361931.31
     362932.32
     363933.33
     364934.34
     365935.35
     366936.36
     367937.37
     368938.38
     369939.39
     370940.40
     371941.41
     372942.42
     373943.43
     374944.44
     375945.45
     376946.46
     377947.47
     378948.48
     379949.49
     380950.50
     381951.51
     382952.52
     383953.53
     384954.54
     385955.55
     386956.56
     387957.57
     388958.58
     389959.59
     390960.60
     391961.61
     392962.62
     393963.63
     394964.64
     395965.65
     396966.66
     397967.67
     398968.68
     399969.69
     400970.70
     401971.71
  • trunk/WebCore/ChangeLog

    r62374 r62375  
     12010-07-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Implement AfterAfterBodyMode
     6        https://bugs.webkit.org/show_bug.cgi?id=41501
     7
     8        In implementing this mode, I noticed a bug in the character processing
     9        of the AfterBodyMode, which I fixed by adding a break statement.  Also,
     10        to get one of the new tests to pass, I needed to implement one
     11        notImplemented() in the InBody insertion mode.  Yay for testing.
     12
     13        * html/HTMLTreeBuilder.cpp:
     14        (WebCore::HTMLTreeBuilder::processStartTag):
     15        (WebCore::HTMLTreeBuilder::processEndTag):
     16        (WebCore::HTMLTreeBuilder::processComment):
     17        (WebCore::HTMLTreeBuilder::processCharacter):
     18        (WebCore::HTMLTreeBuilder::processEndOfFile):
     19
    1202010-07-02  Sheriff Bot  <webkit.review.bot@gmail.com>
    221
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r62370 r62375  
    566566        break;
    567567    case AfterBodyMode:
    568         ASSERT(insertionMode() == AfterBodyMode);
     568    case AfterAfterBodyMode:
     569        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
    569570        if (token.name() == htmlTag) {
    570571            insertHTMLStartTagInBody(token);
     
    660661        if (token.name() == htmlTag) {
    661662            if (processBodyEndTagForInBody(token))
    662                 notImplemented(); // Re-process the curent token.
     663                processEndTag(token);
    663664            return;
    664665        }
     
    783784            return;
    784785        }
     786        // Fall through.
     787    case AfterAfterBodyMode:
     788        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
     789        parseError(token);
    785790        m_insertionMode = InBodyMode;
    786791        processEndTag(token);
     
    822827void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
    823828{
    824     if (m_insertionMode == InitialMode || m_insertionMode == BeforeHTMLMode) {
     829    if (m_insertionMode == InitialMode || m_insertionMode == BeforeHTMLMode || m_insertionMode == AfterAfterBodyMode) {
    825830        insertCommentOnDocument(token);
    826831        return;
     
    868873        break;
    869874    case AfterBodyMode:
    870         ASSERT(insertionMode() == AfterBodyMode);
     875    case AfterAfterBodyMode:
     876        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
     877        parseError(token);
    871878        m_insertionMode = InBodyMode;
    872879        processCharacter(token);
     880        break;
    873881    case TextMode:
    874882        notImplemented();
     
    913921        break;
    914922    case AfterBodyMode:
    915         ASSERT(insertionMode() == AfterBodyMode);
     923    case AfterAfterBodyMode:
     924        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
    916925        notImplemented();
    917926        break;
Note: See TracChangeset for help on using the changeset viewer.