2010-07-02 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jul 2010 10:14:14 +0000 (10:14 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jul 2010 10:14:14 +0000 (10:14 +0000)
        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/html5lib/resources/webkit01.dat
LayoutTests/html5lib/runner-expected-html5.txt
LayoutTests/html5lib/runner-expected.txt
LayoutTests/html5lib/webkit-resumer-expected.txt
WebCore/ChangeLog
WebCore/html/HTMLTreeBuilder.cpp

index 1083d81..a94bef8 100644 (file)
@@ -1,3 +1,20 @@
+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  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Remove accidentally added expectations on Chromium Linux - they should be derived from Windows ones.
index 64ae498..a69f909 100644 (file)
@@ -268,3 +268,44 @@ console.log("FOO<span>BAR</span>BAZ");
 |     <bdy>
 |       <br>
 |         foo="bar"
+
+#data
+<html><body></body></html><!-- Hi there -->
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+| <!--  Hi there  -->
+
+#data
+<html><body></body></html>x<!-- Hi there -->
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+
+#data
+<html><body></body></html>x<!-- Hi there --></html><!-- Again -->
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+| <!--  Again  -->
+
+#data
+<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+| <!--  Again  -->
index fb2e4eb..1909272 100644 (file)
@@ -1727,7 +1727,6 @@ Got:
 |   <body>
 |     "X"
 |     "X"
-|     "X"
 Expected:
 | <!DOCTYPE html>
 | <html>
@@ -1931,7 +1930,6 @@ Got:
 |   <body>
 |     "X"
 |     "X"
-|     "X"
 Expected:
 | <!DOCTYPE html>
 | <html>
@@ -1948,7 +1946,6 @@ Got:
 |   <body>
 |     "X"
 |     " "
-|     " "
 Expected:
 | <!DOCTYPE html>
 | <html>
@@ -3740,6 +3737,13 @@ Got:
 | <html>
 |   <head>
 |   <body>
+|     <math>
+|       <mi>
+|         "foo"
+|       <mi>
+|         "bar"
+|       <p>
+|         "baz"
 Expected:
 | <!DOCTYPE html>
 | <html>
@@ -4235,6 +4239,13 @@ Got:
 | <html>
 |   <head>
 |   <body>
+|     <svg>
+|       <g>
+|         "foo"
+|       <g>
+|         "bar"
+|       <p>
+|         "baz"
 Expected:
 | <!DOCTYPE html>
 | <html>
@@ -5691,7 +5702,7 @@ Expected:
 resources/webkit01.dat:
 17
 
-Test 17 of 23 in resources/webkit01.dat failed. Input:
+Test 17 of 27 in resources/webkit01.dat failed. Input:
 <A>test< /A>
 Got:
 | <html>
index 484d339..04a50f0 100644 (file)
@@ -4689,8 +4689,11 @@ resources/webkit01.dat:
 17
 20
 22
+24
+26
+27
 
-Test 17 of 23 in resources/webkit01.dat failed. Input:
+Test 17 of 27 in resources/webkit01.dat failed. Input:
 <A>test< /A>
 Got:
 | <html>
@@ -4706,7 +4709,7 @@ Expected:
 |     <a>
 |       "test< /A>"
 
-Test 20 of 23 in resources/webkit01.dat failed. Input:
+Test 20 of 27 in resources/webkit01.dat failed. Input:
 <body></br foo="bar"></body>
 Got:
 | <html>
@@ -4720,7 +4723,7 @@ Expected:
 |   <body>
 |     <br>
 
-Test 22 of 23 in resources/webkit01.dat failed. Input:
+Test 22 of 27 in resources/webkit01.dat failed. Input:
 <body></body></br foo="bar">
 Got:
 | <html>
@@ -4733,6 +4736,53 @@ Expected:
 |   <head>
 |   <body>
 |     <br>
+
+Test 24 of 27 in resources/webkit01.dat failed. Input:
+<html><body></body></html><!-- Hi there -->
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <!--  Hi there  -->
+Expected:
+| <html>
+|   <head>
+|   <body>
+| <!--  Hi there  -->
+
+Test 26 of 27 in resources/webkit01.dat failed. Input:
+<html><body></body></html>x<!-- Hi there --></html><!-- Again -->
+Got:
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+|     <!--  Again  -->
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+| <!--  Again  -->
+
+Test 27 of 27 in resources/webkit01.dat failed. Input:
+<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
+Got:
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+|     <!--  Again  -->
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     "x"
+|     <!--  Hi there  -->
+| <!--  Again  -->
 resources/doctype01.dat: PASS
 
 resources/scriptdata01.dat: PASS
index 0d61b63..930c070 100644 (file)
@@ -222,3 +222,180 @@ resources/webkit01.dat:
 724.25
 725.26
 726.27
+752.1
+753.2
+754.3
+755.4
+756.5
+757.6
+758.7
+759.8
+760.9
+761.10
+762.11
+763.12
+764.13
+765.14
+766.15
+767.16
+768.17
+769.18
+770.19
+771.20
+772.21
+773.22
+774.23
+775.24
+776.25
+777.26
+778.27
+779.28
+780.29
+781.30
+782.31
+783.32
+784.33
+785.34
+786.35
+787.36
+788.37
+789.38
+790.39
+791.40
+792.41
+793.42
+837.1
+838.2
+839.3
+840.4
+841.5
+842.6
+843.7
+844.8
+845.9
+846.10
+847.11
+848.12
+849.13
+850.14
+851.15
+852.16
+853.17
+854.18
+855.19
+856.20
+857.21
+858.22
+859.23
+860.24
+861.25
+862.26
+863.27
+864.28
+865.29
+866.30
+867.31
+868.32
+869.33
+870.34
+871.35
+872.36
+873.37
+874.38
+875.39
+876.40
+877.41
+878.42
+879.43
+880.44
+881.45
+882.46
+883.47
+884.48
+885.49
+886.50
+887.51
+888.52
+889.53
+890.54
+891.55
+892.56
+893.57
+894.58
+895.59
+896.60
+897.61
+898.62
+899.63
+900.64
+901.1
+902.2
+903.3
+904.4
+905.5
+906.6
+907.7
+908.8
+909.9
+910.10
+911.11
+912.12
+913.13
+914.14
+915.15
+916.16
+917.17
+918.18
+919.19
+920.20
+921.21
+922.22
+923.23
+924.24
+925.25
+926.26
+927.27
+928.28
+929.29
+930.30
+931.31
+932.32
+933.33
+934.34
+935.35
+936.36
+937.37
+938.38
+939.39
+940.40
+941.41
+942.42
+943.43
+944.44
+945.45
+946.46
+947.47
+948.48
+949.49
+950.50
+951.51
+952.52
+953.53
+954.54
+955.55
+956.56
+957.57
+958.58
+959.59
+960.60
+961.61
+962.62
+963.63
+964.64
+965.65
+966.66
+967.67
+968.68
+969.69
+970.70
+971.71
index c3b9d94..0dd6451 100644 (file)
@@ -1,3 +1,22 @@
+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):
+
 2010-07-02  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r62371.
index c29a4b7..aa272ef 100644 (file)
@@ -565,7 +565,8 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
         insertElement(token);
         break;
     case AfterBodyMode:
-        ASSERT(insertionMode() == AfterBodyMode);
+    case AfterAfterBodyMode:
+        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
         if (token.name() == htmlTag) {
             insertHTMLStartTagInBody(token);
             return;
@@ -659,7 +660,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
         }
         if (token.name() == htmlTag) {
             if (processBodyEndTagForInBody(token))
-                notImplemented(); // Re-process the curent token.
+                processEndTag(token);
             return;
         }
         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) {
@@ -782,6 +783,10 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
             m_insertionMode = AfterAfterBodyMode;
             return;
         }
+        // Fall through.
+    case AfterAfterBodyMode:
+        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
+        parseError(token);
         m_insertionMode = InBodyMode;
         processEndTag(token);
         break;
@@ -821,7 +826,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
 
 void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
 {
-    if (m_insertionMode == InitialMode || m_insertionMode == BeforeHTMLMode) {
+    if (m_insertionMode == InitialMode || m_insertionMode == BeforeHTMLMode || m_insertionMode == AfterAfterBodyMode) {
         insertCommentOnDocument(token);
         return;
     }
@@ -867,9 +872,12 @@ void HTMLTreeBuilder::processCharacter(AtomicHTMLToken& token)
         insertTextNode(token);
         break;
     case AfterBodyMode:
-        ASSERT(insertionMode() == AfterBodyMode);
+    case AfterAfterBodyMode:
+        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
+        parseError(token);
         m_insertionMode = InBodyMode;
         processCharacter(token);
+        break;
     case TextMode:
         notImplemented();
         insertTextNode(token);
@@ -912,7 +920,8 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
         notImplemented();
         break;
     case AfterBodyMode:
-        ASSERT(insertionMode() == AfterBodyMode);
+    case AfterAfterBodyMode:
+        ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
         notImplemented();
         break;
     case InHeadNoscriptMode: