diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-01-12 11:28:22 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-01-12 11:28:22 (GMT) |
commit | 04bdf9f6a77e9ebf96431f89b8240a037b3d2b09 (patch) | |
tree | b79f63e113a1b025421dcafb821e026376011a64 /src/3rdparty/webkit/WebCore/xml | |
parent | d1f73b7be62b0f6e9294b5d78ccd0680cb9fe118 (diff) | |
download | Qt-04bdf9f6a77e9ebf96431f89b8240a037b3d2b09.zip Qt-04bdf9f6a77e9ebf96431f89b8240a037b3d2b09.tar.gz Qt-04bdf9f6a77e9ebf96431f89b8240a037b3d2b09.tar.bz2 |
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( bd6591b4acaf2172ab05702153ef539c0ac89cbb )
Changes in WebKit/qt since the last update:
++ b/WebKit/qt/ChangeLog
2009-12-18 Joe Ligman <joseph.ligman@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow
then checking current frame and then ancestors
https://bugs.webkit.org/show_bug.cgi?id=32668
* Api/qwebframe.cpp:
(QWebFramePrivate::scrollOverflow):
(QWebFrame::scrollRecursively):
* Api/qwebframe.h:
* Api/qwebframe_p.h:
* tests/qwebframe/qwebframe.qrc:
* tests/qwebframe/testiframe.html: Added.
* tests/qwebframe/testiframe2.html: Added.
* tests/qwebframe/tst_qwebframe.cpp:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/xml')
-rw-r--r-- | src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp index 50ee427..3e05ca0 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp @@ -36,6 +36,7 @@ #include <wtf/Vector.h> #include <qabstractmessagehandler.h> +#include <qabstracturiresolver.h> #include <qbuffer.h> #include <qsourcelocation.h> #include <qxmlquery.h> @@ -87,6 +88,31 @@ void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& descriptio sourceLocation.line(), sourceLocation.uri().toString()); } +class XSLTUriResolver : public QAbstractUriResolver { + +public: + XSLTUriResolver(Document* document); + virtual QUrl resolve(const QUrl& relative, const QUrl& baseURI) const; + +private: + Document* m_document; +}; + +XSLTUriResolver::XSLTUriResolver(Document* document) + : QAbstractUriResolver() + , m_document(document) +{ +} + +QUrl XSLTUriResolver::resolve(const QUrl& relative, const QUrl& baseURI) const +{ + QUrl url = baseURI.resolved(relative); + + if (!m_document->frame() || !m_document->securityOrigin()->canRequest(url)) + return QUrl(); + return url; +} + bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultString, String&) { bool success = false; @@ -107,6 +133,7 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS QXmlQuery query(QXmlQuery::XSLT20); XSLTMessageHandler messageHandler(ownerDocument.get()); + XSLTUriResolver uriResolver(ownerDocument.get()); query.setMessageHandler(&messageHandler); XSLTProcessor::ParameterMap::iterator end = m_parameters.end(); @@ -132,6 +159,9 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS query.setFocus(&inputBuffer); query.setQuery(&styleSheetBuffer, QUrl(stylesheet->href())); + + query.setUriResolver(&uriResolver); + success = query.evaluateTo(&outputBuffer); outputBuffer.reset(); resultString = QString::fromUtf8(outputBuffer.readAll()).trimmed(); |