[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 11:15:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 92bbe599a65b0cdc57a9384f89417346869fba7f
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 05:16:18 2010 +0000

    2010-07-15  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Update LegacyHTMLTreeBuilder to insert whitespace between </head> and <body>
            https://bugs.webkit.org/show_bug.cgi?id=42431
    
            Insert these whitespace text nodes into the HTML element between <head>
            and <body>, as required by HTML5.  Previously, we just dropped them on
            the floor.
    
            * html/LegacyHTMLTreeBuilder.cpp:
            (WebCore::LegacyHTMLTreeBuilder::handleError):
    2010-07-15  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Update LegacyHTMLTreeBuilder to insert whitespace between </head> and <body>
            https://bugs.webkit.org/show_bug.cgi?id=42431
    
            Update expected results.  These results match the HTML5 parser.
    
            * editing/deleting/delete-br-in-last-table-cell-expected.txt:
            * fast/innerHTML/005-expected.txt:
            * html5lib/resources/webkit01.dat:
            * html5lib/runner-expected.txt:
            * http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive:
            * http/tests/webarchive/test-css-url-encoding-expected.webarchive:
            * http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive:
            * http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive:
            * platform/mac/css2.1/t1204-root-e-expected.txt:
            * platform/mac/fast/css/empty-generated-content-expected.txt:
            * traversal/exception-forwarding-expected.txt:
            * traversal/script-tests/exception-forwarding.js:
            * webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive:
            * webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive:
            * webarchive/adopt-inline-styled-node-webarchive-expected.webarchive:
            * webarchive/archive-empty-frame-dom-expected.webarchive:
            * webarchive/archive-with-unencoded-url-expected.webarchive:
            * webarchive/test-body-background-expected.webarchive:
            * webarchive/test-css-import-expected.webarchive:
            * webarchive/test-css-url-resources-in-stylesheets-expected.webarchive:
            * webarchive/test-css-url-resources-inline-styles-expected.webarchive:
            * webarchive/test-duplicate-resources-expected.webarchive:
            * webarchive/test-frameset-expected.webarchive:
            * webarchive/test-img-src-expected.webarchive:
            * webarchive/test-input-src-expected.webarchive:
            * webarchive/test-link-href-expected.webarchive:
            * webarchive/test-link-rel-icon-expected.webarchive:
            * webarchive/test-object-data-expected.webarchive:
            * webarchive/test-script-src-expected.webarchive:
            * webarchive/test-table-background-expected.webarchive:
            * webarchive/test-td-background-expected.webarchive:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63517 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 55fa0df..30ffba1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,44 @@
+2010-07-15  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Update LegacyHTMLTreeBuilder to insert whitespace between </head> and <body>
+        https://bugs.webkit.org/show_bug.cgi?id=42431
+
+        Update expected results.  These results match the HTML5 parser.
+
+        * editing/deleting/delete-br-in-last-table-cell-expected.txt:
+        * fast/innerHTML/005-expected.txt:
+        * html5lib/resources/webkit01.dat:
+        * html5lib/runner-expected.txt:
+        * http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive:
+        * http/tests/webarchive/test-css-url-encoding-expected.webarchive:
+        * http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive:
+        * http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive:
+        * platform/mac/css2.1/t1204-root-e-expected.txt:
+        * platform/mac/fast/css/empty-generated-content-expected.txt:
+        * traversal/exception-forwarding-expected.txt:
+        * traversal/script-tests/exception-forwarding.js:
+        * webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive:
+        * webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive:
+        * webarchive/adopt-inline-styled-node-webarchive-expected.webarchive:
+        * webarchive/archive-empty-frame-dom-expected.webarchive:
+        * webarchive/archive-with-unencoded-url-expected.webarchive:
+        * webarchive/test-body-background-expected.webarchive:
+        * webarchive/test-css-import-expected.webarchive:
+        * webarchive/test-css-url-resources-in-stylesheets-expected.webarchive:
+        * webarchive/test-css-url-resources-inline-styles-expected.webarchive:
+        * webarchive/test-duplicate-resources-expected.webarchive:
+        * webarchive/test-frameset-expected.webarchive:
+        * webarchive/test-img-src-expected.webarchive:
+        * webarchive/test-input-src-expected.webarchive:
+        * webarchive/test-link-href-expected.webarchive:
+        * webarchive/test-link-rel-icon-expected.webarchive:
+        * webarchive/test-object-data-expected.webarchive:
+        * webarchive/test-script-src-expected.webarchive:
+        * webarchive/test-table-background-expected.webarchive:
+        * webarchive/test-td-background-expected.webarchive:
+
 2010-07-15  Geoffrey Garen  <ggaren at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/LayoutTests/editing/deleting/delete-br-in-last-table-cell-expected.txt b/LayoutTests/editing/deleting/delete-br-in-last-table-cell-expected.txt
index 1f8b294..da61d09 100644
--- a/LayoutTests/editing/deleting/delete-br-in-last-table-cell-expected.txt
+++ b/LayoutTests/editing/deleting/delete-br-in-last-table-cell-expected.txt
@@ -21,6 +21,9 @@ deleteCommand();
 <#text>
 </#text>
 </HEAD>
+<#text>
+
+</#text>
 <BODY>
 <#text>
 </#text>
diff --git a/LayoutTests/fast/innerHTML/005-expected.txt b/LayoutTests/fast/innerHTML/005-expected.txt
index b084bbe..7304cd0 100644
--- a/LayoutTests/fast/innerHTML/005-expected.txt
+++ b/LayoutTests/fast/innerHTML/005-expected.txt
@@ -2,7 +2,8 @@ Content:
 <head>
 <meta name="description" content="This tests html output">
 <title>html innerHTML test</title>
-</head><body>
+</head>
+<body>
 <span>Content:</span>
 <pre id="content">placeholder</pre>
 <div></div>
diff --git a/LayoutTests/html5lib/resources/webkit01.dat b/LayoutTests/html5lib/resources/webkit01.dat
index 29c1d54..de67842 100644
--- a/LayoutTests/html5lib/resources/webkit01.dat
+++ b/LayoutTests/html5lib/resources/webkit01.dat
@@ -408,3 +408,25 @@ console.log("FOO<span>BAR</span>BAZ");
 |         <nobr>
 |           "a"
 |         <nobr>
+
+#data
+<head></head>
+<body></body>
+#errors
+#document
+| <html>
+|   <head>
+|   "
+"
+|   <body>
+
+#data
+<head></head> <style></style>ddd
+#errors
+#document
+| <html>
+|   <head>
+|     <style>
+|   " "
+|   <body>
+|     "ddd"
diff --git a/LayoutTests/html5lib/runner-expected.txt b/LayoutTests/html5lib/runner-expected.txt
index 2ed1da5..2109948 100644
--- a/LayoutTests/html5lib/runner-expected.txt
+++ b/LayoutTests/html5lib/runner-expected.txt
@@ -4377,7 +4377,7 @@ resources/webkit01.dat:
 31
 33
 
-Test 20 of 33 in resources/webkit01.dat failed. Input:
+Test 20 of 35 in resources/webkit01.dat failed. Input:
 <body></br foo="bar"></body>
 Got:
 | <html>
@@ -4391,7 +4391,7 @@ Expected:
 |   <body>
 |     <br>
 
-Test 22 of 33 in resources/webkit01.dat failed. Input:
+Test 22 of 35 in resources/webkit01.dat failed. Input:
 <body></body></br foo="bar">
 Got:
 | <html>
@@ -4405,7 +4405,7 @@ Expected:
 |   <body>
 |     <br>
 
-Test 24 of 33 in resources/webkit01.dat failed. Input:
+Test 24 of 35 in resources/webkit01.dat failed. Input:
 <html><body></body></html><!-- Hi there -->
 Got:
 | <html>
@@ -4418,7 +4418,7 @@ Expected:
 |   <body>
 | <!--  Hi there  -->
 
-Test 26 of 33 in resources/webkit01.dat failed. Input:
+Test 26 of 35 in resources/webkit01.dat failed. Input:
 <html><body></body></html>x<!-- Hi there --></html><!-- Again -->
 Got:
 | <html>
@@ -4435,7 +4435,7 @@ Expected:
 |     <!--  Hi there  -->
 | <!--  Again  -->
 
-Test 27 of 33 in resources/webkit01.dat failed. Input:
+Test 27 of 35 in resources/webkit01.dat failed. Input:
 <html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
 Got:
 | <html>
@@ -4452,7 +4452,7 @@ Expected:
 |     <!--  Hi there  -->
 | <!--  Again  -->
 
-Test 28 of 33 in resources/webkit01.dat failed. Input:
+Test 28 of 35 in resources/webkit01.dat failed. Input:
 <html><body><ruby><div><rp>xx</rp></div></ruby></body></html>
 Got:
 | <html>
@@ -4471,7 +4471,7 @@ Expected:
 |       <rp>
 |         "xx"
 
-Test 29 of 33 in resources/webkit01.dat failed. Input:
+Test 29 of 35 in resources/webkit01.dat failed. Input:
 <html><body><ruby><div><rt>xx</rt></div></ruby></body></html>
 Got:
 | <html>
@@ -4490,7 +4490,7 @@ Expected:
 |       <rt>
 |         "xx"
 
-Test 30 of 33 in resources/webkit01.dat failed. Input:
+Test 30 of 35 in resources/webkit01.dat failed. Input:
 <html><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--></html><!--5--><noframes>C</noframes><!--6-->
 Got:
 | <html>
@@ -4520,7 +4520,7 @@ Expected:
 | <!-- 5 -->
 | <!-- 6 -->
 
-Test 31 of 33 in resources/webkit01.dat failed. Input:
+Test 31 of 35 in resources/webkit01.dat failed. Input:
 <select><option>A<select><option>B<select><option>C<select><option>D<select><option>E<select><option>F<select><option>G<select>
 Got:
 | <html>
@@ -4564,7 +4564,7 @@ Expected:
 |         <option>
 |           "G"
 
-Test 33 of 33 in resources/webkit01.dat failed. Input:
+Test 33 of 35 in resources/webkit01.dat failed. Input:
 <div><b></div><div><nobr>a<nobr>
 Got:
 | <html>
diff --git a/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive
index 2d674de..8828aa8 100644
--- a/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive
+++ b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive
@@ -11,7 +11,8 @@ if (window.layoutTestController)
     layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
 &lt;link rel="stylesheet" href="http://localhost:8000/webarchive/resources/localhost-stylesheet.css" type="text/css"&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 This HTML links to an external stylesheet from a different security origin.&lt;br&gt;
 Making a webarchive of this page should not crash.
 
diff --git a/LayoutTests/http/tests/webarchive/test-css-url-encoding-expected.webarchive b/LayoutTests/http/tests/webarchive/test-css-url-encoding-expected.webarchive
index fbd16bd..84a6531 100644
--- a/LayoutTests/http/tests/webarchive/test-css-url-encoding-expected.webarchive
+++ b/LayoutTests/http/tests/webarchive/test-css-url-encoding-expected.webarchive
@@ -13,7 +13,8 @@
 if (window.layoutTestController)
     layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
 Test for &lt;a href="https://bugs.webkit.org/show_bug.cgi?id=11850"&gt;Bug 11850:
 Webarchive fails to save images referenced in CSS&lt;/a&gt;
diff --git a/LayoutTests/http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive b/LayoutTests/http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive
index fc55136..19e418a 100644
--- a/LayoutTests/http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive
+++ b/LayoutTests/http/tests/webarchive/test-css-url-encoding-shift-jis-expected.webarchive
@@ -15,7 +15,8 @@
 if (window.layoutTestController)
     layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
 Test for &lt;a href="https://bugs.webkit.org/show_bug.cgi?id=11850"&gt;Bug 11850:
 Webarchive fails to save images referenced in CSS&lt;/a&gt;
diff --git a/LayoutTests/http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive b/LayoutTests/http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive
index 2f99c8d..b478fd4 100644
--- a/LayoutTests/http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive
+++ b/LayoutTests/http/tests/webarchive/test-css-url-encoding-utf-8-expected.webarchive
@@ -15,7 +15,8 @@
 if (window.layoutTestController)
     layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
 Test for &lt;a href="https://bugs.webkit.org/show_bug.cgi?id=11850"&gt;Bug 11850:
 Webarchive fails to save images referenced in CSS&lt;/a&gt;
diff --git a/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt b/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt
index 6f14a4b..300efad 100644
--- a/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt
+++ b/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt
@@ -5,6 +5,7 @@ layer at (0,0) size 800x94
     RenderBlock (anonymous) at (0,0) size 800x0
       RenderInline (generated) at (0,0) size 0x0
         RenderText at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
     RenderBody {BODY} at (8,16) size 784x70
       RenderBlock {P} at (0,0) size 784x18
         RenderText {#text} at (0,0) size 216x18
diff --git a/LayoutTests/platform/mac/fast/css/empty-generated-content-expected.txt b/LayoutTests/platform/mac/fast/css/empty-generated-content-expected.txt
index e488319..0ff354a 100644
--- a/LayoutTests/platform/mac/fast/css/empty-generated-content-expected.txt
+++ b/LayoutTests/platform/mac/fast/css/empty-generated-content-expected.txt
@@ -2,6 +2,8 @@ layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x34
   RenderBlock {HTML} at (0,0) size 800x34
+    RenderBlock (anonymous) at (0,0) size 800x0
+      RenderText {#text} at (0,0) size 0x0
     RenderBody {BODY} at (8,8) size 784x18
       RenderText {#text} at (0,0) size 211x18
         text run at (0,0) width 211: "This page intentionally left blank."
diff --git a/LayoutTests/traversal/exception-forwarding-expected.txt b/LayoutTests/traversal/exception-forwarding-expected.txt
index 08a2a01..8173f20 100644
--- a/LayoutTests/traversal/exception-forwarding-expected.txt
+++ b/LayoutTests/traversal/exception-forwarding-expected.txt
@@ -13,8 +13,8 @@ PASS w.firstChild() threw exception Roses.
 PASS w.lastChild() threw exception Roses.
 PASS w.nextSibling() threw exception Roses.
 PASS w.previousSibling() is null
-PASS w.nextSibling() is document.body
-PASS w.previousSibling() is document.body.previousSibling
+PASS w.nextSibling() is document.body.previousSibling
+PASS w.previousSibling() is document.head
 PASS iteration is 11
 PASS successfullyParsed is true
 
diff --git a/LayoutTests/traversal/script-tests/exception-forwarding.js b/LayoutTests/traversal/script-tests/exception-forwarding.js
index 0875919..9a70139 100644
--- a/LayoutTests/traversal/script-tests/exception-forwarding.js
+++ b/LayoutTests/traversal/script-tests/exception-forwarding.js
@@ -23,8 +23,8 @@ shouldThrow("w.firstChild()"); // 7
 shouldThrow("w.lastChild()"); // 8
 shouldThrow("w.nextSibling()"); // 9
 shouldBe("w.previousSibling()", "null");
-shouldBe("w.nextSibling()", "document.body"); // 10
-shouldBe("w.previousSibling()", "document.body.previousSibling"); // 11
+shouldBe("w.nextSibling()", "document.body.previousSibling"); // 10
+shouldBe("w.previousSibling()", "document.head"); // 11
 shouldBe("iteration", "11");
 
 var successfullyParsed = true;
diff --git a/LayoutTests/webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive b/LayoutTests/webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive
index 69eb976..762c369 100644
--- a/LayoutTests/webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive
+++ b/LayoutTests/webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive
@@ -63,7 +63,9 @@ function procedeAfterClosedWindow()
 }
 
 &lt;/script&gt;
-&lt;/head&gt;&lt;body onload="startTest();"&gt;
+&lt;/head&gt;
+
+&lt;body onload="startTest();"&gt;
 &lt;span id="testSpan"&gt;This test takes a body with inline link color styling from a second window, moves it to the document of an iframe, makes sure the 
 second window has closed, then makes a WebArchive.  The test passes if it doesn't crash.  If running the test in Safari then garbage collection might get in the
 way of fulling testing the bug.  One should wait "awhile" before making the WebArchive.&lt;br&gt;&lt;/span&gt;&lt;br&gt;
diff --git a/LayoutTests/webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive b/LayoutTests/webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive
index 8e03288..8791278 100644
--- a/LayoutTests/webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive
+++ b/LayoutTests/webarchive/adopt-attribute-styled-node-webarchive-expected.webarchive
@@ -63,7 +63,9 @@ function procedeAfterClosedWindow()
 }
 
 &lt;/script&gt;
-&lt;/head&gt;&lt;body onload="startTest();"&gt;
+&lt;/head&gt;
+
+&lt;body onload="startTest();"&gt;
 &lt;span id="testSpan"&gt;This test takes a node with mapped style attributes from a different document, moves it to this document, makes sure the other document has closed,
 then makes a WebArchive from this document.  The test passes if it doesn't crash.  If running the test in Safari then garbage collection might get in the
 way of fulling testing the bug.  One should wait "awhile" before making the WebArchive.&lt;br&gt;&lt;marquee id="otherMarquee" bgcolor="blue" width="300px"&gt;Hello there marquee!&lt;/marquee&gt;&lt;/span&gt;
diff --git a/LayoutTests/webarchive/adopt-inline-styled-node-webarchive-expected.webarchive b/LayoutTests/webarchive/adopt-inline-styled-node-webarchive-expected.webarchive
index e398bf0..ea1fc8d 100644
--- a/LayoutTests/webarchive/adopt-inline-styled-node-webarchive-expected.webarchive
+++ b/LayoutTests/webarchive/adopt-inline-styled-node-webarchive-expected.webarchive
@@ -63,7 +63,9 @@ function procedeAfterClosedWindow()
 }
 
 &lt;/script&gt;
-&lt;/head&gt;&lt;body onload="startTest();"&gt;
+&lt;/head&gt;
+
+&lt;body onload="startTest();"&gt;
 &lt;span id="testSpan"&gt;This test takes a node with inline style from a different document, moves it to this document, makes sure the other document has closed,
 then makes a WebArchive from this document.  The test passes if it doesn't crash.  If running the test in Safari then garbage collection might get in the
 way of fulling testing the bug.  One should wait "awhile" before making the WebArchive.&lt;br&gt;&lt;span id="otherSpan" style="color: red"&gt;Spaceballs:The Styled Node&lt;/span&gt;&lt;/span&gt;
diff --git a/LayoutTests/webarchive/archive-empty-frame-dom-expected.webarchive b/LayoutTests/webarchive/archive-empty-frame-dom-expected.webarchive
index 3b8de4f..fa0b059 100644
--- a/LayoutTests/webarchive/archive-empty-frame-dom-expected.webarchive
+++ b/LayoutTests/webarchive/archive-empty-frame-dom-expected.webarchive
@@ -11,7 +11,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 
 &lt;p&gt;
 Here lies an `iframe` with no content/src:
diff --git a/LayoutTests/webarchive/archive-with-unencoded-url-expected.webarchive b/LayoutTests/webarchive/archive-with-unencoded-url-expected.webarchive
index a0d11b2..4d96007 100644
--- a/LayoutTests/webarchive/archive-with-unencoded-url-expected.webarchive
+++ b/LayoutTests/webarchive/archive-with-unencoded-url-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;form&gt;
     &lt;input type="image" src="resources/apple.gif?foo|bar"&gt;
 &lt;/form&gt;
diff --git a/LayoutTests/webarchive/test-body-background-expected.webarchive b/LayoutTests/webarchive/test-body-background-expected.webarchive
index 2148a1e..ce30f59 100644
--- a/LayoutTests/webarchive/test-body-background-expected.webarchive
+++ b/LayoutTests/webarchive/test-body-background-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body background="resources/apple.gif"&gt;
+&lt;/head&gt;
+&lt;body background="resources/apple.gif"&gt;
 
 
 &lt;/body&gt;&lt;/html&gt;</string>
diff --git a/LayoutTests/webarchive/test-css-import-expected.webarchive b/LayoutTests/webarchive/test-css-import-expected.webarchive
index 0509fa2..ce5ca68 100644
--- a/LayoutTests/webarchive/test-css-import-expected.webarchive
+++ b/LayoutTests/webarchive/test-css-import-expected.webarchive
@@ -14,7 +14,8 @@
 &lt;style type="text/css"&gt;
     @import url('resources/test-css-import.css');
 &lt;/style&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div class="blue"&gt;This text should be blue.&lt;/div&gt;
 &lt;div class="red"&gt;This text should be red.&lt;/div&gt;
 &lt;div class="green"&gt;This text should be green.&lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-css-url-resources-in-stylesheets-expected.webarchive b/LayoutTests/webarchive/test-css-url-resources-in-stylesheets-expected.webarchive
index d39ebd3..557c3f3 100644
--- a/LayoutTests/webarchive/test-css-url-resources-in-stylesheets-expected.webarchive
+++ b/LayoutTests/webarchive/test-css-url-resources-in-stylesheets-expected.webarchive
@@ -134,7 +134,8 @@ div.webkit-mask-image-list {
 }
 
 &lt;/style&gt;
-&lt;/head&gt;&lt;body onload="notifyDone()"&gt;
+&lt;/head&gt;
+&lt;body onload="notifyDone()"&gt;
 &lt;div&gt;&lt;p&gt;This page tests that url() resources referenced in CSS stylesheets are saved in webarchives.&lt;/p&gt;&lt;/div&gt;
 &lt;div class="background"&gt;This element should have one Apple logo in the background at the top left.&lt;/div&gt;
 &lt;div class="background-image"&gt;This element should have repeated Apple logos in both x- and y-dimensions in the background.&lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-css-url-resources-inline-styles-expected.webarchive b/LayoutTests/webarchive/test-css-url-resources-inline-styles-expected.webarchive
index 057d802..4f386bd 100644
--- a/LayoutTests/webarchive/test-css-url-resources-inline-styles-expected.webarchive
+++ b/LayoutTests/webarchive/test-css-url-resources-inline-styles-expected.webarchive
@@ -28,7 +28,8 @@ function notifyDone()
     src: url(firstInvalidURL), url(secondInvalidURL), url(resources/Ahem.ttf);
 }
 &lt;/style&gt;
-&lt;/head&gt;&lt;body onload="notifyDone()"&gt;
+&lt;/head&gt;
+&lt;body onload="notifyDone()"&gt;
 &lt;div&gt;&lt;p&gt;This page tests that url() resources referenced in CSS stylesheets are saved in webarchives.&lt;/p&gt;&lt;/div&gt;
 &lt;div style="border: solid black 1px; height: 64px; background: url(resources/apple.gif?background) no-repeat top left;"&gt;This element should have one Apple logo in the background at the top left.&lt;/div&gt;
 &lt;div style="border: solid black 1px; height: 125px; background-image: url(resources/apple.gif?background-image);"&gt;This element should have repeated Apple logos in both x- and y-dimensions in the background.&lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-duplicate-resources-expected.webarchive b/LayoutTests/webarchive/test-duplicate-resources-expected.webarchive
index 103785a..6a3a0a1 100644
--- a/LayoutTests/webarchive/test-duplicate-resources-expected.webarchive
+++ b/LayoutTests/webarchive/test-duplicate-resources-expected.webarchive
@@ -10,7 +10,8 @@
 &lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
 &lt;script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"&gt;&lt;/script&gt;
 &lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
   &lt;img src="resources/apple.gif"&gt;
 &lt;/div&gt;
@@ -41,7 +42,8 @@
 				<key>WebResourceData</key>
 				<string>&lt;html&gt;&lt;head&gt;
 &lt;link rel="stylesheet" href="test-style.css" type="text/css"&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
   &lt;img src="apple.gif"&gt;
 &lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-frameset-expected.webarchive b/LayoutTests/webarchive/test-frameset-expected.webarchive
index 3491a88..147cb54 100644
--- a/LayoutTests/webarchive/test-frameset-expected.webarchive
+++ b/LayoutTests/webarchive/test-frameset-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;frameset rows="*"&gt;
+&lt;/head&gt;
+&lt;frameset rows="*"&gt;
   &lt;frame src="resources/test-frame.html" name="myframe"&gt;
 &lt;/frameset&gt;&lt;/html&gt;</string>
 		<key>WebResourceFrameName</key>
@@ -30,7 +31,8 @@
 				<key>WebResourceData</key>
 				<string>&lt;html&gt;&lt;head&gt;
 &lt;link rel="stylesheet" href="test-style.css" type="text/css"&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
   &lt;img src="apple.gif"&gt;
 &lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-img-src-expected.webarchive b/LayoutTests/webarchive/test-img-src-expected.webarchive
index 9b9a08b..b524469 100644
--- a/LayoutTests/webarchive/test-img-src-expected.webarchive
+++ b/LayoutTests/webarchive/test-img-src-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
   &lt;img src="resources/apple.gif"&gt;
 
 
diff --git a/LayoutTests/webarchive/test-input-src-expected.webarchive b/LayoutTests/webarchive/test-input-src-expected.webarchive
index 2f95fb8..804a2b7 100644
--- a/LayoutTests/webarchive/test-input-src-expected.webarchive
+++ b/LayoutTests/webarchive/test-input-src-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;form&gt;
 &lt;input type="image" src="resources/apple.gif"&gt;
 &lt;/form&gt;
diff --git a/LayoutTests/webarchive/test-link-href-expected.webarchive b/LayoutTests/webarchive/test-link-href-expected.webarchive
index 560c060..27d4483 100644
--- a/LayoutTests/webarchive/test-link-href-expected.webarchive
+++ b/LayoutTests/webarchive/test-link-href-expected.webarchive
@@ -11,7 +11,8 @@
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
 &lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 &lt;div&gt;
 This text should be red sans-serif.
 &lt;/div&gt;
diff --git a/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive b/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
index 19d50b2..e023e53 100644
--- a/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
+++ b/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
@@ -17,7 +17,8 @@ function runTest()
 }
 &lt;/script&gt;
 &lt;link rel="icon" href="resources/favicon.ico" type="image/x-icon"&gt;
-&lt;/head&gt;&lt;body onload="runTest()"&gt;
+&lt;/head&gt;
+&lt;body onload="runTest()"&gt;
 
 
 &lt;/body&gt;&lt;/html&gt;</string>
diff --git a/LayoutTests/webarchive/test-object-data-expected.webarchive b/LayoutTests/webarchive/test-object-data-expected.webarchive
index 87d4352..29e0856 100644
--- a/LayoutTests/webarchive/test-object-data-expected.webarchive
+++ b/LayoutTests/webarchive/test-object-data-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
   &lt;object data="resources/apple.gif" type="image/gif"&gt;&lt;/object&gt;
 
 
diff --git a/LayoutTests/webarchive/test-script-src-expected.webarchive b/LayoutTests/webarchive/test-script-src-expected.webarchive
index 2e3b365..cc9701c 100644
--- a/LayoutTests/webarchive/test-script-src-expected.webarchive
+++ b/LayoutTests/webarchive/test-script-src-expected.webarchive
@@ -7,7 +7,8 @@
 		<key>WebResourceData</key>
 		<string>&lt;html&gt;&lt;head&gt;
 &lt;script src="resources/dump-webarchive.js" type="text/javascript"&gt;&lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
 
 
 &lt;/body&gt;&lt;/html&gt;</string>
diff --git a/LayoutTests/webarchive/test-table-background-expected.webarchive b/LayoutTests/webarchive/test-table-background-expected.webarchive
index ac9bbcf..c76a09e 100644
--- a/LayoutTests/webarchive/test-table-background-expected.webarchive
+++ b/LayoutTests/webarchive/test-table-background-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
   &lt;table background="resources/apple.gif" style="width: 52px; height: 64px;"&gt;
     &lt;tbody&gt;&lt;tr&gt;
     &lt;/tr&gt;
diff --git a/LayoutTests/webarchive/test-td-background-expected.webarchive b/LayoutTests/webarchive/test-td-background-expected.webarchive
index f0a895f..ccdbc72 100644
--- a/LayoutTests/webarchive/test-td-background-expected.webarchive
+++ b/LayoutTests/webarchive/test-td-background-expected.webarchive
@@ -10,7 +10,8 @@
     if (window.layoutTestController)
         layoutTestController.dumpDOMAsWebArchive();
 &lt;/script&gt;
-&lt;/head&gt;&lt;body&gt;
+&lt;/head&gt;
+&lt;body&gt;
   &lt;table&gt;
     &lt;tbody&gt;&lt;tr&gt;
       &lt;td background="resources/apple.gif"&gt;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 099ece2..36345e8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-15  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Update LegacyHTMLTreeBuilder to insert whitespace between </head> and <body>
+        https://bugs.webkit.org/show_bug.cgi?id=42431
+
+        Insert these whitespace text nodes into the HTML element between <head>
+        and <body>, as required by HTML5.  Previously, we just dropped them on
+        the floor.
+
+        * html/LegacyHTMLTreeBuilder.cpp:
+        (WebCore::LegacyHTMLTreeBuilder::handleError):
+
 2010-07-15  Victor Wang  <victorw at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/html/LegacyHTMLTreeBuilder.cpp b/WebCore/html/LegacyHTMLTreeBuilder.cpp
index 0434316..ee0bcfc 100644
--- a/WebCore/html/LegacyHTMLTreeBuilder.cpp
+++ b/WebCore/html/LegacyHTMLTreeBuilder.cpp
@@ -283,7 +283,8 @@ PassRefPtr<Node> LegacyHTMLTreeBuilder::parseToken(Token* t)
         Node* previousChild = m_current->lastChild();
         if (previousChild && previousChild->isTextNode()) {
             // Only coalesce text nodes if the text node wouldn't be foster parented.
-            if (!m_current->hasTagName(tableTag)
+            if (!m_current->hasTagName(htmlTag)
+                && !m_current->hasTagName(tableTag)
                 && !m_current->hasTagName(trTag)
                 && !m_current->hasTagName(theadTag)
                 && !m_current->hasTagName(tbodyTag)
@@ -588,8 +589,17 @@ bool LegacyHTMLTreeBuilder::handleError(Node* n, bool flat, const AtomicString&
             } else {
                 if (n->isTextNode()) {
                     Text* t = static_cast<Text*>(n);
-                    if (t->containsOnlyWhitespace())
+                    if (t->containsOnlyWhitespace()) {
+                        if (m_head && !m_inBody) {
+                            // We're between </head> and <body>.  According to
+                            // the HTML5 parsing algorithm, we're supposed to
+                            // insert whitespace text nodes into the HTML element.
+                            ExceptionCode ec;
+                            m_current->appendChild(n, ec);
+                            return true;
+                        }
                         return false;
+                    }
                 }
                 if (!m_haveFrameSet) {
                     // Ensure that head exists.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list