summaryrefslogtreecommitdiffstats
path: root/WebCore/xml/XSLTProcessor.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/xml/XSLTProcessor.cpp
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/xml/XSLTProcessor.cpp')
-rw-r--r--WebCore/xml/XSLTProcessor.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index 97b5466..61f414e 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -33,13 +33,12 @@
#include "FrameLoader.h"
#include "FrameView.h"
#include "HTMLDocument.h"
-#include "HTMLDocumentParser.h" // for parseHTMLDocumentFragment
#include "Page.h"
#include "Text.h"
#include "TextResourceDecoder.h"
-#include "XMLDocumentParser.h"
#include "loader.h"
#include "markup.h"
+
#include <wtf/Assertions.h>
#include <wtf/Vector.h>
@@ -69,10 +68,10 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
RefPtr<Document> result;
if (sourceMIMEType == "text/plain") {
- result = Document::create(frame);
+ result = Document::create(frame, sourceIsDocument ? ownerDocument->url() : KURL());
transformTextStringToXHTMLDocumentString(documentSource);
} else
- result = DOMImplementation::createDocument(sourceMIMEType, frame, false);
+ result = DOMImplementation::createDocument(sourceMIMEType, frame, sourceIsDocument ? ownerDocument->url() : KURL(), false);
// Before parsing, we need to save & detach the old document and get the new document
// in place. We have to do this only if we're rendering the result document.
@@ -83,8 +82,6 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
frame->setDocument(result);
}
- if (sourceIsDocument)
- result->setURL(ownerDocument->url());
result->open();
RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType);
@@ -100,14 +97,14 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
static inline RefPtr<DocumentFragment> createFragmentFromSource(const String& sourceString, const String& sourceMIMEType, Document* outputDoc)
{
- RefPtr<DocumentFragment> fragment = DocumentFragment::create(outputDoc);
+ RefPtr<DocumentFragment> fragment = outputDoc->createDocumentFragment();
if (sourceMIMEType == "text/html")
- parseHTMLDocumentFragment(sourceString, fragment.get());
+ fragment->parseHTML(sourceString);
else if (sourceMIMEType == "text/plain")
fragment->addChild(Text::create(outputDoc, sourceString));
else {
- bool successfulParse = parseXMLDocumentFragment(sourceString, fragment.get(), outputDoc->documentElement());
+ bool successfulParse = fragment->parseXML(sourceString, outputDoc->documentElement());
if (!successfulParse)
return 0;
}