[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:57:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d14148d3d2b4f9ac9333ac1a1593204b0e5a86ca
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 12 02:55:27 2010 +0000

    2010-08-11  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Conditionalize wrong fragment parsing code to pass more HTML5lib tests
            https://bugs.webkit.org/show_bug.cgi?id=43877
    
            Test progression.
    
            * html5lib/runner-expected-html5.txt:
    2010-08-11  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Conditionalize wrong fragment parsing code to pass more HTML5lib tests
            https://bugs.webkit.org/show_bug.cgi?id=43877
    
            This code exists to support the LegacyHTMLTreeBuilder.  Unfortunately,
            it causes problems for the new HTMLTreeBuilder (which is more
            self-contained).
    
            * dom/Element.cpp:
            (WebCore::Element::createContextualFragment):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2256ba4..3470108 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,16 @@
 2010-08-11  Adam Barth  <abarth at webkit.org>
 
+        Reviewed by Eric Seidel.
+
+        Conditionalize wrong fragment parsing code to pass more HTML5lib tests
+        https://bugs.webkit.org/show_bug.cgi?id=43877
+
+        Test progression.
+
+        * html5lib/runner-expected-html5.txt:
+
+2010-08-11  Adam Barth  <abarth at webkit.org>
+
         Reviewed by Alexey Proskuryakov.
 
         fast/encoding/japanese-encoding-mix.html fails on Tiger after enabling HTML5 Lexer
diff --git a/LayoutTests/html5lib/runner-expected-html5.txt b/LayoutTests/html5lib/runner-expected-html5.txt
index 5ca2329..fdbd8da 100644
--- a/LayoutTests/html5lib/runner-expected-html5.txt
+++ b/LayoutTests/html5lib/runner-expected-html5.txt
@@ -17,18 +17,8 @@ resources/tests2.dat: PASS
 resources/tests3.dat: PASS
 
 resources/tests4.dat:
-6
 7
 
-Test 6 of 7 in resources/tests4.dat failed. Input:
-setting html's innerHTML
-Got:
-| "setting html's innerHTML"
-Expected:
-| <head>
-| <body>
-|   "setting html's innerHTML"
-
 Test 7 of 7 in resources/tests4.dat failed. Input:
 <title>setting head's innerHTML</title>
 Got:
@@ -41,7 +31,6 @@ resources/tests5.dat: PASS
 resources/tests6.dat:
 27
 30
-45
 
 Test 27 of 51 in resources/tests6.dat failed. Input:
 foo<col>
@@ -56,27 +45,9 @@ Got:
 | 
 Expected:
 | <frame>
-
-Test 45 of 51 in resources/tests6.dat failed. Input:
-<body></body></html>
-Got:
-| 
-Expected:
-| <head>
-| <body>
 resources/tests7.dat:
-24
 30
 
-Test 24 of 30 in resources/tests7.dat failed. Input:
-<body>X</body></body>
-Got:
-| "X"
-Expected:
-| <head>
-| <body>
-|   "X"
-
 Test 30 of 30 in resources/tests7.dat failed. Input:
 <select><keygen>
 Got:
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 53d3ec0..6bc79a5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-11  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Conditionalize wrong fragment parsing code to pass more HTML5lib tests
+        https://bugs.webkit.org/show_bug.cgi?id=43877
+
+        This code exists to support the LegacyHTMLTreeBuilder.  Unfortunately,
+        it causes problems for the new HTMLTreeBuilder (which is more
+        self-contained).
+
+        * dom/Element.cpp:
+        (WebCore::Element::createContextualFragment):
+
 2010-08-11  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Tony Chang.
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 0e89e93..cc3bf1f 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -50,6 +50,7 @@
 #include "RenderLayer.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
+#include "Settings.h"
 #include "TextIterator.h"
 #include "XMLNames.h"
 #include <wtf/text/CString.h>
@@ -102,36 +103,37 @@ PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& mar
             return 0;
     }
     
-    // Exceptions are ignored because none ought to happen here.
-    ExceptionCode ignoredExceptionCode;
-    
-    // We need to pop <html> and <body> elements and remove <head> to
-    // accommodate folks passing complete HTML documents to make the
-    // child of an element.
-    
-    RefPtr<Node> nextNode;
-    for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
-        nextNode = node->nextSibling();
-        if (node->hasTagName(htmlTag) || node->hasTagName(bodyTag)) {
-            Node* firstChild = node->firstChild();
-            if (firstChild)
-                nextNode = firstChild;
-            RefPtr<Node> nextChild;
-            for (RefPtr<Node> child = firstChild; child; child = nextChild) {
-                nextChild = child->nextSibling();
-                node->removeChild(child.get(), ignoredExceptionCode);
+    if (!document()->settings() || !document()->settings()->html5TreeBuilderEnabled()) {
+        // Exceptions are ignored because none ought to happen here.
+        ExceptionCode ignoredExceptionCode;
+        
+        // We need to pop <html> and <body> elements and remove <head> to
+        // accommodate folks passing complete HTML documents to make the
+        // child of an element.
+        
+        RefPtr<Node> nextNode;
+        for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
+            nextNode = node->nextSibling();
+            if (node->hasTagName(htmlTag) || node->hasTagName(bodyTag)) {
+                Node* firstChild = node->firstChild();
+                if (firstChild)
+                    nextNode = firstChild;
+                RefPtr<Node> nextChild;
+                for (RefPtr<Node> child = firstChild; child; child = nextChild) {
+                    nextChild = child->nextSibling();
+                    node->removeChild(child.get(), ignoredExceptionCode);
+                    ASSERT(!ignoredExceptionCode);
+                    fragment->insertBefore(child, node.get(), ignoredExceptionCode);
+                    ASSERT(!ignoredExceptionCode);
+                }
+                fragment->removeChild(node.get(), ignoredExceptionCode);
                 ASSERT(!ignoredExceptionCode);
-                fragment->insertBefore(child, node.get(), ignoredExceptionCode);
+            } else if (node->hasTagName(headTag)) {
+                fragment->removeChild(node.get(), ignoredExceptionCode);
                 ASSERT(!ignoredExceptionCode);
             }
-            fragment->removeChild(node.get(), ignoredExceptionCode);
-            ASSERT(!ignoredExceptionCode);
-        } else if (node->hasTagName(headTag)) {
-            fragment->removeChild(node.get(), ignoredExceptionCode);
-            ASSERT(!ignoredExceptionCode);
         }
     }
-    
     return fragment.release();
 }
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list