diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-06 10:36:47 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-06 10:36:47 (GMT) |
commit | bb35b65bbfba82e0dd0ac306d3dab54436cdaff6 (patch) | |
tree | 8174cb262a960ff7b2e4aa8f1aaf154db71d2636 /src/3rdparty/webkit/WebCore/xml | |
parent | 4b27d0d887269583a0f76e922948f8c25e96ab88 (diff) | |
download | Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.zip Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.gz Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.bz2 |
Update src/3rdparty/webkit from trunk.
Imported from 839d8709327f925aacb3b6362c06152594def97e
in branch qtwebkit-2.0 of repository
git://gitorious.org/+qtwebkit-developers/webkit/qtwebkit.git
Rubber-stamped-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit/WebCore/xml')
31 files changed, 379 insertions, 101 deletions
diff --git a/src/3rdparty/webkit/WebCore/xml/DOMParser.idl b/src/3rdparty/webkit/WebCore/xml/DOMParser.idl index 9caaa21..90a8b52 100644 --- a/src/3rdparty/webkit/WebCore/xml/DOMParser.idl +++ b/src/3rdparty/webkit/WebCore/xml/DOMParser.idl @@ -18,7 +18,7 @@ */ module xpath { - interface [GenerateConstructor, CanBeConstructed] DOMParser { + interface [CanBeConstructed] DOMParser { Document parseFromString(in DOMString str, in DOMString contentType); }; } diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp index 87a6540..f10b589 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp @@ -22,16 +22,17 @@ #include "config.h" #include "XMLHttpRequest.h" +#include "Blob.h" #include "Cache.h" #include "CString.h" #include "CrossOriginAccessControl.h" +#include "DOMFormData.h" #include "DOMImplementation.h" #include "Document.h" #include "Event.h" #include "EventException.h" #include "EventListener.h" #include "EventNames.h" -#include "File.h" #include "HTTPParsers.h" #include "InspectorTimelineAgent.h" #include "ResourceError.h" @@ -59,7 +60,7 @@ namespace WebCore { static WTF::RefCountedLeakCounter xmlHttpRequestCounter("XMLHttpRequest"); #endif -struct XMLHttpRequestStaticData { +struct XMLHttpRequestStaticData : Noncopyable { XMLHttpRequestStaticData(); String m_proxyHeaderPrefix; String m_secHeaderPrefix; @@ -157,6 +158,7 @@ XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext* context) , m_receivedLength(0) , m_lastSendLineNumber(0) , m_exceptionCode(0) + , m_progressEventThrottle(this) { initializeXMLHttpRequestStaticData(); #ifndef NDEBUG @@ -214,7 +216,7 @@ Document* XMLHttpRequest::responseXML() const // The W3C spec requires this. m_responseXML = 0; } else { - m_responseXML = document()->implementation()->createDocument(0); + m_responseXML = Document::create(0); m_responseXML->open(); m_responseXML->setURL(m_url); // FIXME: Set Last-Modified. @@ -253,27 +255,30 @@ void XMLHttpRequest::callReadyStateChangeListener() #if ENABLE(INSPECTOR) InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext()); - if (timelineAgent) + bool callTimelineAgentOnReadyStateChange = timelineAgent && hasEventListeners(eventNames().readystatechangeEvent); + if (callTimelineAgentOnReadyStateChange) timelineAgent->willChangeXHRReadyState(m_url.string(), m_state); #endif - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent); #if ENABLE(INSPECTOR) - if (timelineAgent) + if (callTimelineAgentOnReadyStateChange && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext()))) timelineAgent->didChangeXHRReadyState(); #endif if (m_state == DONE && !m_error) { #if ENABLE(INSPECTOR) - if (timelineAgent) + timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext()); + bool callTimelineAgentOnLoad = timelineAgent && hasEventListeners(eventNames().loadEvent); + if (callTimelineAgentOnLoad) timelineAgent->willLoadXHR(m_url.string()); #endif - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent)); #if ENABLE(INSPECTOR) - if (timelineAgent) + if (callTimelineAgentOnLoad && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext()))) timelineAgent->didLoadXHR(); #endif } @@ -289,6 +294,11 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec) m_includeCredentials = value; } +void XMLHttpRequest::open(const String& method, const KURL& url, ExceptionCode& ec) +{ + open(method, url, true, ec); +} + void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionCode& ec) { internalAbort(); @@ -432,7 +442,7 @@ void XMLHttpRequest::send(const String& body, ExceptionCode& ec) createRequest(ec); } -void XMLHttpRequest::send(File* body, ExceptionCode& ec) +void XMLHttpRequest::send(Blob* body, ExceptionCode& ec) { if (!initSend(ec)) return; @@ -441,7 +451,30 @@ void XMLHttpRequest::send(File* body, ExceptionCode& ec) // FIXME: Should we set a Content-Type if one is not set. // FIXME: add support for uploading bundles. m_requestEntityBody = FormData::create(); +#if ENABLE(BLOB_SLICE) + m_requestEntityBody->appendFileRange(body->path(), body->start(), body->length(), body->modificationTime()); +#else m_requestEntityBody->appendFile(body->path(), false); +#endif + } + + createRequest(ec); +} + +void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec) +{ + if (!initSend(ec)) + return; + + if (m_method != "GET" && m_method != "HEAD" && m_url.protocolInHTTPFamily()) { + m_requestEntityBody = FormData::createMultiPart(*body, document()); + + String contentType = getRequestHeader("Content-Type"); + if (contentType.isEmpty()) { + contentType = "multipart/form-data; boundary="; + contentType += m_requestEntityBody->boundary().data(); + setRequestHeaderInternal("Content-Type", contentType); + } } createRequest(ec); @@ -454,7 +487,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec) // Also, only async requests support upload progress events. bool forcePreflight = false; if (m_async) { - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); if (m_requestEntityBody && m_upload) { forcePreflight = m_upload->hasEventListeners(); m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); @@ -546,7 +579,7 @@ void XMLHttpRequest::abort() m_state = UNSENT; } - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent)); if (!m_uploadComplete) { m_uploadComplete = true; if (m_upload && m_uploadEventsAllowed) @@ -600,7 +633,7 @@ void XMLHttpRequest::genericError() void XMLHttpRequest::networkError() { genericError(); - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().errorEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().errorEvent)); if (!m_uploadComplete) { m_uploadComplete = true; if (m_upload && m_uploadEventsAllowed) @@ -612,7 +645,7 @@ void XMLHttpRequest::networkError() void XMLHttpRequest::abortError() { genericError(); - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent)); + m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent)); if (!m_uploadComplete) { m_uploadComplete = true; if (m_upload && m_uploadEventsAllowed) @@ -629,8 +662,9 @@ void XMLHttpRequest::dropProtection() // out. But it is protected from GC while loading, so this // can't be recouped until the load is done, so only // report the extra cost at that point. - if (DOMObject* wrapper = getCachedDOMObjectWrapper(*scriptExecutionContext()->globalData(), this)) - JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2); + JSC::JSGlobalData* globalData = scriptExecutionContext()->globalData(); + if (hasCachedDOMObjectWrapper(globalData, this)) + globalData->heap.reportExtraMemoryCost(m_responseText.size() * 2); #endif unsetPendingActivity(this); @@ -914,9 +948,8 @@ void XMLHttpRequest::didReceiveData(const char* data, int len) long long expectedLength = m_response.expectedContentLength(); m_receivedLength += len; - // FIXME: the spec requires that we dispatch the event according to the least - // frequent method between every 350ms (+/-200ms) and for every byte received. - dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, expectedLength && m_receivedLength <= expectedLength, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength))); + bool lengthComputable = expectedLength && m_receivedLength <= expectedLength; + m_progressEventThrottle.dispatchProgressEvent(lengthComputable, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength)); if (m_state != LOADING) changeState(LOADING); @@ -931,6 +964,16 @@ bool XMLHttpRequest::canSuspend() const return !m_loader; } +void XMLHttpRequest::suspend() +{ + m_progressEventThrottle.suspend(); +} + +void XMLHttpRequest::resume() +{ + m_progressEventThrottle.resume(); +} + void XMLHttpRequest::stop() { internalAbort(); diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.h b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.h index c7e0192..ca308cc 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.h +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.h @@ -29,13 +29,15 @@ #include "ResourceResponse.h" #include "ScriptString.h" #include "ThreadableLoaderClient.h" +#include "XMLHttpRequestProgressEventThrottle.h" #include <wtf/OwnPtr.h> namespace WebCore { +class Blob; class Document; -class File; -struct ResourceRequest; +class DOMFormData; +class ResourceRequest; class TextResourceDecoder; class ThreadableLoader; @@ -57,6 +59,8 @@ public: virtual void contextDestroyed(); virtual bool canSuspend() const; + virtual void suspend(); + virtual void resume(); virtual void stop(); virtual ScriptExecutionContext* scriptExecutionContext() const; @@ -66,13 +70,15 @@ public: State readyState() const; bool withCredentials() const { return m_includeCredentials; } void setWithCredentials(bool, ExceptionCode&); + void open(const String& method, const KURL&, ExceptionCode&); void open(const String& method, const KURL&, bool async, ExceptionCode&); void open(const String& method, const KURL&, bool async, const String& user, ExceptionCode&); void open(const String& method, const KURL&, bool async, const String& user, const String& password, ExceptionCode&); void send(ExceptionCode&); void send(Document*, ExceptionCode&); void send(const String&, ExceptionCode&); - void send(File*, ExceptionCode&); + void send(Blob*, ExceptionCode&); + void send(DOMFormData*, ExceptionCode&); void abort(); void setRequestHeader(const AtomicString& name, const String& value, ExceptionCode&); void overrideMimeType(const String& override); @@ -184,6 +190,8 @@ private: ExceptionCode m_exceptionCode; EventTargetData m_eventTargetData; + + XMLHttpRequestProgressEventThrottle m_progressEventThrottle; }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.idl b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.idl index 89d9c7f..5a86fe5 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.idl +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.idl @@ -29,6 +29,7 @@ module xml { interface [ + CustomConstructor, CustomMarkFunction, EventTarget, NoStaticTables @@ -90,12 +91,12 @@ module xml { [Custom] void overrideMimeType(in DOMString override); // EventTarget interface - [Custom] void addEventListener(in DOMString type, - in EventListener listener, - in boolean useCapture); - [Custom] void removeEventListener(in DOMString type, + [JSCCustom] void addEventListener(in DOMString type, in EventListener listener, in boolean useCapture); + [JSCCustom] void removeEventListener(in DOMString type, + in EventListener listener, + in boolean useCapture); boolean dispatchEvent(in Event evt) raises(EventException); }; diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestException.idl b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestException.idl index 380e426..7121468 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestException.idl +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestException.idl @@ -29,7 +29,6 @@ module xml { interface [ - GenerateConstructor, NoStaticTables ] XMLHttpRequestException { diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEvent.idl b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEvent.idl index 549308b..bc5055a 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEvent.idl +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEvent.idl @@ -26,7 +26,6 @@ module events { interface [ - GenerateConstructor, NoStaticTables // We should also inherit from LSProgressEvent when the idl is added. ] XMLHttpRequestProgressEvent : ProgressEvent { diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp new file mode 100644 index 0000000..0eb6398 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> + * All right reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "XMLHttpRequestProgressEventThrottle.h" + +#include "EventTarget.h" +#include "XMLHttpRequestProgressEvent.h" + +namespace WebCore { + +const double XMLHttpRequestProgressEventThrottle::minimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification. + +XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(EventTarget* target) + : m_target(target) + , m_loaded(0) + , m_total(0) + , m_suspended(false) +{ + ASSERT(target); +} + +XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() +{ +} + +void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(bool lengthComputable, unsigned loaded, unsigned total) +{ + ASSERT(!suspended()); + if (!isActive()) { + // The timer is not active so the least frequent event for now is every byte. + // Just go ahead and dispatch the event. + + // We should not have any pending loaded & total information from a previous run. + ASSERT(!m_loaded); + ASSERT(!m_total); + + dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, lengthComputable, loaded, total)); + startRepeating(minimumProgressEventDispatchingIntervalInSeconds); + return; + } + + // The timer is already active so minimumProgressEventDispatchingIntervalInSeconds is the least frequent event. + m_lengthComputable = lengthComputable; + m_loaded = loaded; + m_total = total; +} + +void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction) +{ + ASSERT(!suspended()); + // We should not have any pending events from a previous resume. + ASSERT(!m_pausedEvent); + + if (progressEventAction == FlushProgressEvent) + flushProgressEvent(); + + m_target->dispatchEvent(event); +} + +void XMLHttpRequestProgressEventThrottle::flushProgressEvent() +{ + if (!hasEventToDispatch()) + return; + + PassRefPtr<Event> event = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total); + m_loaded = 0; + m_total = 0; + + // We stop the timer as this is called when no more events are supposed to occur. + stop(); + + m_target->dispatchEvent(event); +} + +void XMLHttpRequestProgressEventThrottle::dispatchPausedEvent() +{ + ASSERT(!suspended()); + if (!m_pausedEvent) + return; + + m_target->dispatchEvent(m_pausedEvent); + m_pausedEvent = 0; +} + +void XMLHttpRequestProgressEventThrottle::fired() +{ + ASSERT(isActive()); + ASSERT(!suspended()); + ASSERT(!m_pausedEvent); + if (!hasEventToDispatch()) { + // No progress event was queued since the previous dispatch, we can safely stop the timer. + stop(); + return; + } + + m_target->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total)); + m_total = 0; + m_loaded = 0; +} + +bool XMLHttpRequestProgressEventThrottle::hasEventToDispatch() const +{ + return (m_total || m_loaded) && isActive(); +} + +void XMLHttpRequestProgressEventThrottle::suspend() +{ + ASSERT(!m_pausedEvent); + + m_suspended = true; + // If we have a progress event waiting to be dispatched, + // just queue it. + if (hasEventToDispatch()) { + m_pausedEvent = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total); + m_total = 0; + m_loaded = 0; + } + stop(); +} + +void XMLHttpRequestProgressEventThrottle::resume() +{ + ASSERT(!m_loaded); + ASSERT(!m_total); + + m_suspended = false; + dispatchPausedEvent(); +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.h b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.h new file mode 100644 index 0000000..f51aea1 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestProgressEventThrottle.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> + * All right reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef XMLHttpRequestProgressEventThrottle_h +#define XMLHttpRequestProgressEventThrottle_h + +#include "Timer.h" +#include "wtf/PassRefPtr.h" +#include "wtf/Vector.h" + +namespace WebCore { + +class Event; +class EventTarget; + +enum ProgressEventAction { + DoNotFlushProgressEvent, + FlushProgressEvent +}; + +// This implements the XHR2 progress event dispatching: "dispatch a progress event called progress +// about every 50ms or for every byte received, whichever is least frequent". +class XMLHttpRequestProgressEventThrottle : public TimerBase { +public: + XMLHttpRequestProgressEventThrottle(EventTarget*); + virtual ~XMLHttpRequestProgressEventThrottle(); + + void dispatchProgressEvent(bool lengthComputable, unsigned loaded, unsigned total); + void dispatchEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent); + + void suspend(); + void resume(); + + bool suspended() const { return m_suspended; } + +private: + static const double minimumProgressEventDispatchingIntervalInSeconds; + + virtual void fired(); + void dispatchPausedEvent(); + void flushProgressEvent(); + + bool hasEventToDispatch() const; + + // Weak pointer to our XMLHttpRequest object as it is the one holding us. + EventTarget* m_target; + + bool m_lengthComputable; + unsigned m_loaded; + unsigned m_total; + + bool m_suspended; + RefPtr<Event> m_pausedEvent; +}; + +} // namespace WebCore + +#endif // XMLHttpRequestProgressEventThrottle_h diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestUpload.idl b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestUpload.idl index 901b47c..a712a37 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestUpload.idl +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequestUpload.idl @@ -31,7 +31,6 @@ module xml { interface [ CustomMarkFunction, EventTarget, - GenerateConstructor, NoStaticTables ] XMLHttpRequestUpload { // From XMLHttpRequestEventTarget @@ -43,12 +42,12 @@ module xml { attribute EventListener onprogress; // EventTarget interface - [Custom] void addEventListener(in DOMString type, - in EventListener listener, - in boolean useCapture); - [Custom] void removeEventListener(in DOMString type, + [JSCCustom] void addEventListener(in DOMString type, in EventListener listener, in boolean useCapture); + [JSCCustom] void removeEventListener(in DOMString type, + in EventListener listener, + in boolean useCapture); boolean dispatchEvent(in Event evt) raises(EventException); }; diff --git a/src/3rdparty/webkit/WebCore/xml/XMLSerializer.idl b/src/3rdparty/webkit/WebCore/xml/XMLSerializer.idl index 6dcc3a4..8c59446 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLSerializer.idl +++ b/src/3rdparty/webkit/WebCore/xml/XMLSerializer.idl @@ -20,7 +20,7 @@ module xpath { - interface [GenerateConstructor, CanBeConstructed] XMLSerializer { + interface [CanBeConstructed] XMLSerializer { DOMString serializeToString(in Node node) raises(DOMException); }; diff --git a/src/3rdparty/webkit/WebCore/xml/XPathEvaluator.idl b/src/3rdparty/webkit/WebCore/xml/XPathEvaluator.idl index da6155b..c075b01 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathEvaluator.idl +++ b/src/3rdparty/webkit/WebCore/xml/XPathEvaluator.idl @@ -18,7 +18,7 @@ */ module xpath { - interface [GenerateConstructor, CanBeConstructed, Conditional=XPATH] XPathEvaluator { + interface [CanBeConstructed, Conditional=XPATH] XPathEvaluator { XPathExpression createExpression(in DOMString expression, in XPathNSResolver resolver) raises(core::DOMException); diff --git a/src/3rdparty/webkit/WebCore/xml/XPathException.idl b/src/3rdparty/webkit/WebCore/xml/XPathException.idl index c3c95e3..d5a9af6 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathException.idl +++ b/src/3rdparty/webkit/WebCore/xml/XPathException.idl @@ -29,7 +29,6 @@ module xpath { interface [ - GenerateConstructor, Conditional=XPATH ] XPathException { diff --git a/src/3rdparty/webkit/WebCore/xml/XPathExpression.idl b/src/3rdparty/webkit/WebCore/xml/XPathExpression.idl index c1fc15e..6b6ceeb 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathExpression.idl +++ b/src/3rdparty/webkit/WebCore/xml/XPathExpression.idl @@ -22,8 +22,7 @@ module xpath { interface [ - Conditional=XPATH, - GenerateConstructor + Conditional=XPATH ] XPathExpression { [OldStyleObjC] XPathResult evaluate(in Node contextNode, in unsigned short type, diff --git a/src/3rdparty/webkit/WebCore/xml/XPathExpressionNode.h b/src/3rdparty/webkit/WebCore/xml/XPathExpressionNode.h index 74b134e..38070b9 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathExpressionNode.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathExpressionNode.h @@ -39,7 +39,7 @@ namespace WebCore { namespace XPath { - struct EvaluationContext { + struct EvaluationContext : FastAllocBase { RefPtr<Node> node; unsigned long size; unsigned long position; diff --git a/src/3rdparty/webkit/WebCore/xml/XPathNSResolver.idl b/src/3rdparty/webkit/WebCore/xml/XPathNSResolver.idl index 48c0113..4e996c2 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathNSResolver.idl +++ b/src/3rdparty/webkit/WebCore/xml/XPathNSResolver.idl @@ -20,7 +20,7 @@ module xpath { - interface [ObjCProtocol, Conditional=XPATH] XPathNSResolver { + interface [ObjCProtocol, Conditional=XPATH, OmitConstructor] XPathNSResolver { [ConvertNullStringTo=Null] DOMString lookupNamespaceURI(in DOMString prefix); }; diff --git a/src/3rdparty/webkit/WebCore/xml/XPathNodeSet.h b/src/3rdparty/webkit/WebCore/xml/XPathNodeSet.h index 1130488..d5c47be 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathNodeSet.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathNodeSet.h @@ -37,7 +37,7 @@ namespace WebCore { namespace XPath { - class NodeSet { + class NodeSet : public FastAllocBase { public: NodeSet() : m_isSorted(true), m_subtreesAreDisjoint(false) { } diff --git a/src/3rdparty/webkit/WebCore/xml/XPathResult.idl b/src/3rdparty/webkit/WebCore/xml/XPathResult.idl index bc36c3e..ebbff42 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathResult.idl +++ b/src/3rdparty/webkit/WebCore/xml/XPathResult.idl @@ -19,7 +19,7 @@ module xpath { - interface [GenerateConstructor, Conditional=XPATH] XPathResult { + interface [Conditional=XPATH] XPathResult { const unsigned short ANY_TYPE = 0; const unsigned short NUMBER_TYPE = 1; const unsigned short STRING_TYPE = 2; diff --git a/src/3rdparty/webkit/WebCore/xml/XPathStep.cpp b/src/3rdparty/webkit/WebCore/xml/XPathStep.cpp index 411b616..6e60952 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathStep.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XPathStep.cpp @@ -34,6 +34,7 @@ #include "Document.h" #include "Element.h" #include "NamedNodeMap.h" +#include "XMLNSNames.h" #include "XPathParser.h" #include "XPathUtil.h" @@ -173,7 +174,7 @@ static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step: ASSERT(node->isAttributeNode()); // In XPath land, namespace nodes are not accessible on the attribute axis. - if (node->namespaceURI() == "http://www.w3.org/2000/xmlns/") + if (node->namespaceURI() == XMLNSNames::xmlnsNamespaceURI) return false; if (name == starAtom) @@ -193,9 +194,13 @@ static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step: if (name == starAtom) return namespaceURI.isEmpty() || namespaceURI == node->namespaceURI(); - if (node->isHTMLElement() && node->document()->isHTMLDocument()) { - // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively. - return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); + if (node->document()->isHTMLDocument()) { + if (node->isHTMLElement()) { + // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively. + return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); + } + // An expression without any prefix shouldn't match no-namespace nodes (because HTML5 says so). + return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI() && !namespaceURI.isNull(); } return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI(); } @@ -331,7 +336,7 @@ void Step::nodesInAxis(Node* context, NodeSet& nodes) const // Avoid lazily creating attribute nodes for attributes that we do not need anyway. if (m_nodeTest.kind() == NodeTest::NameTest && m_nodeTest.data() != starAtom) { RefPtr<Node> n = static_cast<Element*>(context)->getAttributeNodeNS(m_nodeTest.namespaceURI(), m_nodeTest.data()); - if (n && n->namespaceURI() != "http://www.w3.org/2000/xmlns/") { // In XPath land, namespace nodes are not accessible on the attribute axis. + if (n && n->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { // In XPath land, namespace nodes are not accessible on the attribute axis. if (nodeMatches(n.get(), AttributeAxis, m_nodeTest)) // Still need to check merged predicates. nodes.append(n.release()); } diff --git a/src/3rdparty/webkit/WebCore/xml/XPathStep.h b/src/3rdparty/webkit/WebCore/xml/XPathStep.h index 11612e9..ec022b3 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathStep.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathStep.h @@ -49,7 +49,7 @@ namespace WebCore { SelfAxis }; - class NodeTest { + class NodeTest : public FastAllocBase { public: enum Kind { TextNodeTest, CommentNodeTest, ProcessingInstructionNodeTest, AnyNodeTest, NameTest diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp index f5acb38..29e211e 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp @@ -68,12 +68,7 @@ NodeSet& Value::modifiableNodeSet() return m_data->m_nodeSet; } -#if COMPILER(WINSCW) -// FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) -unsigned int Value::toBoolean() const -#else bool Value::toBoolean() const -#endif { switch (m_type) { case NodeSetValue: diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.h b/src/3rdparty/webkit/WebCore/xml/XPathValue.h index bd44c91..a0cd24d 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.h @@ -66,11 +66,8 @@ namespace WebCore { Value(Node* value) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { m_data->m_nodeSet.append(value); } // This is needed to safely implement constructing from bool - with normal function overloading, any pointer type would match. -#if COMPILER(WINSCW) - Value(bool); -#else template<typename T> Value(T); -#endif + static const struct AdoptTag {} adopt; Value(NodeSet& value, const AdoptTag&) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { value.swap(m_data->m_nodeSet); } @@ -83,12 +80,7 @@ namespace WebCore { const NodeSet& toNodeSet() const; NodeSet& modifiableNodeSet(); -#if COMPILER(WINSCW) - // FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) - unsigned int toBoolean() const; -#else bool toBoolean() const; -#endif double toNumber() const; String toString() const; @@ -98,9 +90,8 @@ namespace WebCore { double m_number; RefPtr<ValueData> m_data; }; -#if !COMPILER(WINSCW) + template<> -#endif inline Value::Value(bool value) : m_type(BooleanValue) , m_bool(value) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLImportRule.cpp b/src/3rdparty/webkit/WebCore/xml/XSLImportRule.cpp index b697c0d..0908d75 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLImportRule.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLImportRule.cpp @@ -52,13 +52,13 @@ XSLStyleSheet* XSLImportRule::parentStyleSheet() const return (parent() && parent()->isXSLStyleSheet()) ? static_cast<XSLStyleSheet*>(parent()) : 0; } -void XSLImportRule::setXSLStyleSheet(const String& url, const String& sheet) +void XSLImportRule::setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet) { if (m_styleSheet) m_styleSheet->setParent(0); - - m_styleSheet = XSLStyleSheet::create(this, url); - + + m_styleSheet = XSLStyleSheet::create(this, href, baseURL); + XSLStyleSheet* parent = parentStyleSheet(); if (parent) m_styleSheet->setParentStyleSheet(parent); @@ -87,14 +87,14 @@ void XSLImportRule::loadSheet() String absHref = m_strHref; XSLStyleSheet* parentSheet = parentStyleSheet(); - if (!parentSheet->href().isNull()) + if (!parentSheet->finalURL().isNull()) // use parent styleheet's URL as the base URL - absHref = KURL(KURL(ParsedURLString, parentSheet->href()), m_strHref).string(); + absHref = KURL(parentSheet->finalURL(), m_strHref).string(); // Check for a cycle in our import chain. If we encounter a stylesheet // in our parent chain with the same URL, then just bail. for (parent = this->parent(); parent; parent = parent->parent()) { - if (parent->isXSLStyleSheet() && absHref == static_cast<XSLStyleSheet*>(parent)->href()) + if (parent->isXSLStyleSheet() && absHref == static_cast<XSLStyleSheet*>(parent)->finalURL().string()) return; } diff --git a/src/3rdparty/webkit/WebCore/xml/XSLImportRule.h b/src/3rdparty/webkit/WebCore/xml/XSLImportRule.h index fc7a7f8..f3a9318 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLImportRule.h +++ b/src/3rdparty/webkit/WebCore/xml/XSLImportRule.h @@ -57,7 +57,7 @@ private: virtual bool isImportRule() { return true; } // from CachedResourceClient - virtual void setXSLStyleSheet(const String& url, const String& sheet); + virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet); String m_strHref; RefPtr<XSLStyleSheet> m_styleSheet; diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h index c9729bb..e6e4063 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h @@ -43,18 +43,18 @@ class XSLImportRule; class XSLStyleSheet : public StyleSheet { public: #if !USE(QXMLQUERY) - static PassRefPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& href) + static PassRefPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL) { - return adoptRef(new XSLStyleSheet(parentImport, href)); + return adoptRef(new XSLStyleSheet(parentImport, originalURL, finalURL)); } #endif - static PassRefPtr<XSLStyleSheet> create(Node* parentNode, const String& href) + static PassRefPtr<XSLStyleSheet> create(Node* parentNode, const String& originalURL, const KURL& finalURL) { - return adoptRef(new XSLStyleSheet(parentNode, href, false)); + return adoptRef(new XSLStyleSheet(parentNode, originalURL, finalURL, false)); } - static PassRefPtr<XSLStyleSheet> createEmbedded(Node* parentNode, const String& href) + static PassRefPtr<XSLStyleSheet> createInline(Node* parentNode, const KURL& finalURL) { - return adoptRef(new XSLStyleSheet(parentNode, href, true)); + return adoptRef(new XSLStyleSheet(parentNode, finalURL.string(), finalURL, true)); } virtual ~XSLStyleSheet(); @@ -90,9 +90,9 @@ public: bool processed() const { return m_processed; } private: - XSLStyleSheet(Node* parentNode, const String& href, bool embedded); + XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded); #if !USE(QXMLQUERY) - XSLStyleSheet(XSLImportRule* parentImport, const String& href); + XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL); #endif Document* m_ownerDocument; diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp index 2ae8b82..dbd806a 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp @@ -55,8 +55,8 @@ SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (do namespace WebCore { -XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) - : StyleSheet(parentRule, href) +XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalURL, const KURL& finalURL) + : StyleSheet(parentRule, originalURL, finalURL) , m_ownerDocument(0) , m_embedded(false) , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them. @@ -66,8 +66,8 @@ XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) { } -XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) - : StyleSheet(parentNode, href) +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded) + : StyleSheet(parentNode, originalURL, finalURL) , m_ownerDocument(parentNode->document()) , m_embedded(embedded) , m_processed(true) // The root sheet starts off processed. @@ -168,7 +168,7 @@ bool XSLStyleSheet::parseString(const String& string, bool) } m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size, - href().utf8().data(), + finalURL().string().utf8().data(), BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE", XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA); xmlFreeParserCtxt(ctxt); @@ -192,7 +192,7 @@ void XSLStyleSheet::loadChildSheets() if (m_embedded) { // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the // import/include list. - xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().utf8().data())); + xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(finalURL().string().utf8().data())); if (!idNode) return; stylesheetRoot = idNode->parent; diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp index 6d27e20..cb55993 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp @@ -33,8 +33,8 @@ namespace WebCore { -XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) - : StyleSheet(parentNode, href) +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded) + : StyleSheet(parentNode, originalURL, finalURL) , m_ownerDocument(parentNode->document()) , m_embedded(embedded) { diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp index b182243..b530d52 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp @@ -41,7 +41,6 @@ #include "loader.h" #include "markup.h" #include <wtf/Assertions.h> -#include <wtf/Platform.h> #include <wtf/Vector.h> namespace WebCore { @@ -70,10 +69,10 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc RefPtr<Document> result; if (sourceMIMEType == "text/plain") { - result = ownerDocument->implementation()->createDocument(frame); + result = Document::create(frame); transformTextStringToXHTMLDocumentString(documentSource); } else - result = ownerDocument->implementation()->createDocument(sourceMIMEType, frame, false); + result = DOMImplementation::createDocument(sourceMIMEType, frame, 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. diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.idl b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.idl index 0a6ff93..28bd878 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.idl +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.idl @@ -33,7 +33,8 @@ module xml { // http://bugs.webkit.org/show_bug.cgi?id=5446 interface [ - Conditional=XSLT + Conditional=XSLT, + CustomConstructor ] XSLTProcessor { [Custom] void importStylesheet(in Node stylesheet); diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp index 200c56b..5fa49ea 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp @@ -46,7 +46,6 @@ #include <libxslt/variables.h> #include <libxslt/xsltutils.h> #include <wtf/Assertions.h> -#include <wtf/Platform.h> #include <wtf/Vector.h> #if PLATFORM(MAC) @@ -201,8 +200,8 @@ static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& XSLTProcessor::ParameterMap::iterator end = parameters.end(); unsigned index = 0; for (XSLTProcessor::ParameterMap::iterator it = parameters.begin(); it != end; ++it) { - parameterArray[index++] = strdup(it->first.utf8().data()); - parameterArray[index++] = strdup(it->second.utf8().data()); + parameterArray[index++] = fastStrDup(it->first.utf8().data()); + parameterArray[index++] = fastStrDup(it->second.utf8().data()); } parameterArray[index] = 0; @@ -216,8 +215,8 @@ static void freeXsltParamArray(const char** params) return; while (*temp) { - free((void*)*(temp++)); // strdup returns malloc'd blocks, so we have to use free() here - free((void*)*(temp++)); + fastFree((void*)*(temp++)); + fastFree((void*)*(temp++)); } fastFree(params); } @@ -226,7 +225,8 @@ static xsltStylesheetPtr xsltStylesheetPointer(RefPtr<XSLStyleSheet>& cachedStyl { if (!cachedStylesheet && stylesheetRootNode) { cachedStylesheet = XSLStyleSheet::create(stylesheetRootNode->parent() ? stylesheetRootNode->parent() : stylesheetRootNode, - stylesheetRootNode->document()->url().string()); + stylesheetRootNode->document()->url().string(), + stylesheetRootNode->document()->url()); // FIXME: Should we use baseURL here? cachedStylesheet->parseString(createMarkup(stylesheetRootNode)); } diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp index 3e05ca0..29dbacf 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp @@ -32,7 +32,6 @@ #include "loader.h" #include "markup.h" #include <wtf/Assertions.h> -#include <wtf/Platform.h> #include <wtf/Vector.h> #include <qabstractmessagehandler.h> @@ -120,7 +119,9 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS RefPtr<XSLStyleSheet> stylesheet = m_stylesheet; if (!stylesheet && m_stylesheetRootNode) { Node* node = m_stylesheetRootNode.get(); - stylesheet = XSLStyleSheet::create(node->parent() ? node->parent() : node, node->document()->url().string()); + stylesheet = XSLStyleSheet::create(node->parent() ? node->parent() : node, + node->document()->url().string(), + node->document()->url()); // FIXME: Should we use baseURL here? stylesheet->parseString(createMarkup(node)); } diff --git a/src/3rdparty/webkit/WebCore/xml/xmlnsattrs.in b/src/3rdparty/webkit/WebCore/xml/xmlnsattrs.in new file mode 100644 index 0000000..7ac415a --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/xmlnsattrs.in @@ -0,0 +1,4 @@ +namespace="XMLNS" +namespaceURI="http://www.w3.org/2000/xmlns/" + +xmlns |