summaryrefslogtreecommitdiffstats
path: root/WebCore/xml
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
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')
-rw-r--r--WebCore/xml/DOMParser.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp13
-rw-r--r--WebCore/xml/XSLTProcessor.cpp15
-rw-r--r--WebCore/xml/XSLTProcessor.idl6
4 files changed, 17 insertions, 19 deletions
diff --git a/WebCore/xml/DOMParser.cpp b/WebCore/xml/DOMParser.cpp
index 448dcb1..7e04be7 100644
--- a/WebCore/xml/DOMParser.cpp
+++ b/WebCore/xml/DOMParser.cpp
@@ -29,7 +29,7 @@ PassRefPtr<Document> DOMParser::parseFromString(const String& str, const String&
if (!DOMImplementation::isXMLMIMEType(contentType))
return 0;
- RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, false);
+ RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, KURL(), false);
doc->open();
doc->write(str);
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 831ada9..da95d32 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -240,9 +240,8 @@ Document* XMLHttpRequest::responseXML() const
// The W3C spec requires this.
m_responseXML = 0;
} else {
- m_responseXML = Document::create(0);
+ m_responseXML = Document::create(0, m_url);
m_responseXML->open();
- m_responseXML->setURL(m_url);
// FIXME: Set Last-Modified.
m_responseXML->write(String(m_responseText));
m_responseXML->finishParsing();
@@ -512,11 +511,11 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
// The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not
// permit cross origin requests should look exactly like POSTing to an URL that does not respond at all.
// Also, only async requests support upload progress events.
- bool forcePreflight = false;
+ bool uploadEvents = false;
if (m_async) {
m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
if (m_requestEntityBody && m_upload) {
- forcePreflight = m_upload->hasEventListeners();
+ uploadEvents = m_upload->hasEventListeners();
m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
}
}
@@ -525,7 +524,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
// We also remember whether upload events should be allowed for this request in case the upload listeners are
// added after the request is started.
- m_uploadEventsAllowed = m_sameOriginRequest || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders);
+ m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders);
ResourceRequest request(m_url);
request.setHTTPMethod(m_method);
@@ -542,7 +541,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
ThreadableLoaderOptions options;
options.sendLoadCallbacks = true;
options.sniffContent = false;
- options.forcePreflight = forcePreflight;
+ options.forcePreflight = uploadEvents;
options.allowCredentials = m_sameOriginRequest || m_includeCredentials;
options.crossOriginRequestPolicy = UseAccessControl;
@@ -900,7 +899,7 @@ void XMLHttpRequest::didFinishLoading(unsigned long identifier)
#if ENABLE(INSPECTOR)
if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
- inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText);
+ inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber);
#endif
bool hadLoader = m_loader;
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;
}
diff --git a/WebCore/xml/XSLTProcessor.idl b/WebCore/xml/XSLTProcessor.idl
index 28bd878..dac4b21 100644
--- a/WebCore/xml/XSLTProcessor.idl
+++ b/WebCore/xml/XSLTProcessor.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,7 +34,9 @@ module xml {
interface [
Conditional=XSLT,
- CustomConstructor
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor
] XSLTProcessor {
[Custom] void importStylesheet(in Node stylesheet);