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

eric at webkit.org eric at webkit.org
Wed Dec 22 12:27:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 71353461f15e97692037616302b9d342a0a465cf
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 23 23:49:09 2010 +0000

    2010-08-23  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            fast/xsl/default-html.html fails with HTML5 fragment parsing
            https://bugs.webkit.org/show_bug.cgi?id=44450
    
            This patch is a step down a trail of tears.  As far as I can tell,
            there's no spec for XSLTProcessor.transformToFragment.  This patch
            attempts to infer the proper behavior from test cases and the Mozilla
            wiki.
    
            * xml/XSLTProcessor.cpp:
            (WebCore::createFragmentFromSource):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65844 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a7bd75d..6127caf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,21 @@
 
         Reviewed by Eric Seidel.
 
+        fast/xsl/default-html.html fails with HTML5 fragment parsing
+        https://bugs.webkit.org/show_bug.cgi?id=44450
+
+        This patch is a step down a trail of tears.  As far as I can tell,
+        there's no spec for XSLTProcessor.transformToFragment.  This patch
+        attempts to infer the proper behavior from test cases and the Mozilla
+        wiki.
+
+        * xml/XSLTProcessor.cpp:
+        (WebCore::createFragmentFromSource):
+
+2010-08-23  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         editing/pasteboard/paste-visible-script.html is broken with --html5-treebuilder
         https://bugs.webkit.org/show_bug.cgi?id=44457
 
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index 6e149a1..41569d7 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -32,6 +32,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
+#include "HTMLBodyElement.h"
 #include "HTMLDocument.h"
 #include "Page.h"
 #include "Text.h"
@@ -99,9 +100,16 @@ static inline RefPtr<DocumentFragment> createFragmentFromSource(const String& so
 {
     RefPtr<DocumentFragment> fragment = outputDoc->createDocumentFragment();
 
-    if (sourceMIMEType == "text/html")
-        fragment->parseHTML(sourceString, 0);
-    else if (sourceMIMEType == "text/plain")
+    if (sourceMIMEType == "text/html") {
+        // As far as I can tell, there isn't a spec for how transformToFragment
+        // is supposed to work.  Based on the documentation I can find, it looks
+        // like we want to start parsing the fragment in the InBody insertion
+        // mode.  Unfortunately, that's an implementation detail of the parser.
+        // We achieve that effect here by passing in a fake body element as
+        // context for the fragment.
+        RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc);
+        fragment->parseHTML(sourceString, fakeBody.get());
+    } else if (sourceMIMEType == "text/plain")
         fragment->parserAddChild(Text::create(outputDoc, sourceString));
     else {
         bool successfulParse = fragment->parseXML(sourceString, 0);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list