Changeset 65844 in webkit
- Timestamp:
- Aug 23, 2010 4:49:09 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65843 r65844 1 2010-08-23 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 fast/xsl/default-html.html fails with HTML5 fragment parsing 6 https://bugs.webkit.org/show_bug.cgi?id=44450 7 8 This patch is a step down a trail of tears. As far as I can tell, 9 there's no spec for XSLTProcessor.transformToFragment. This patch 10 attempts to infer the proper behavior from test cases and the Mozilla 11 wiki. 12 13 * xml/XSLTProcessor.cpp: 14 (WebCore::createFragmentFromSource): 15 1 16 2010-08-23 Adam Barth <abarth@webkit.org> 2 17 -
trunk/WebCore/xml/XSLTProcessor.cpp
r65375 r65844 33 33 #include "FrameLoader.h" 34 34 #include "FrameView.h" 35 #include "HTMLBodyElement.h" 35 36 #include "HTMLDocument.h" 36 37 #include "Page.h" … … 100 101 RefPtr<DocumentFragment> fragment = outputDoc->createDocumentFragment(); 101 102 102 if (sourceMIMEType == "text/html") 103 fragment->parseHTML(sourceString, 0); 104 else if (sourceMIMEType == "text/plain") 103 if (sourceMIMEType == "text/html") { 104 // As far as I can tell, there isn't a spec for how transformToFragment 105 // is supposed to work. Based on the documentation I can find, it looks 106 // like we want to start parsing the fragment in the InBody insertion 107 // mode. Unfortunately, that's an implementation detail of the parser. 108 // We achieve that effect here by passing in a fake body element as 109 // context for the fragment. 110 RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc); 111 fragment->parseHTML(sourceString, fakeBody.get()); 112 } else if (sourceMIMEType == "text/plain") 105 113 fragment->parserAddChild(Text::create(outputDoc, sourceString)); 106 114 else {
Note: See TracChangeset
for help on using the changeset viewer.