diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebKit/qt/Api/qwebframe.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebKit/qt/Api/qwebframe.cpp')
-rw-r--r-- | Source/WebKit/qt/Api/qwebframe.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp index 6f98bca..e5124bd 100644 --- a/Source/WebKit/qt/Api/qwebframe.cpp +++ b/Source/WebKit/qt/Api/qwebframe.cpp @@ -731,7 +731,7 @@ QMultiMap<QString, QString> QWebFrame::metaData() const static inline QUrl ensureAbsoluteUrl(const QUrl &url) { - if (!url.isRelative()) + if (!url.isValid() || !url.isRelative()) return url; // This contains the URL with absolute path but without @@ -780,26 +780,7 @@ QUrl QWebFrame::url() const */ QUrl QWebFrame::requestedUrl() const { - // There are some possible edge cases to be handled here, - // apart from checking if activeDocumentLoader is valid: - // - // * Method can be called while processing an unsucessful load. - // In this case, frameLoaderClient will hold the current error - // (m_loadError), and we will make use of it to recover the 'failingURL'. - // * If the 'failingURL' holds a null'ed string though, we fallback - // to 'outgoingReferrer' (it yet is safer than originalRequest). - FrameLoader* loader = d->frame->loader(); - FrameLoaderClientQt* loaderClient = d->frameLoaderClient; - - if (!loader->activeDocumentLoader() - || !loaderClient->m_loadError.isNull()) { - if (!loaderClient->m_loadError.failingURL().isNull()) - return QUrl(loaderClient->m_loadError.failingURL()); - else if (!loader->outgoingReferrer().isEmpty()) - return QUrl(loader->outgoingReferrer()); - } - - return loader->originalRequest().url(); + return d->frameLoaderClient->lastRequestedUrl(); } /*! \since 4.6 @@ -893,11 +874,9 @@ void QWebFrame::load(const QNetworkRequest &req, case QNetworkAccessManager::DeleteOperation: request.setHTTPMethod("DELETE"); break; -#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) case QNetworkAccessManager::CustomOperation: request.setHTTPMethod(req.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray().constData()); break; -#endif case QNetworkAccessManager::UnknownOperation: // eh? break; |