summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/Api/qwebframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/Api/qwebframe.cpp')
-rw-r--r--WebKit/qt/Api/qwebframe.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index e90367e..0bb6922 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -36,6 +36,7 @@
#include "GraphicsContext.h"
#include "HTMLMetaElement.h"
#include "HitTestResult.h"
+#include "HTTPParsers.h"
#include "IconDatabase.h"
#include "InspectorController.h"
#include "JSDOMBinding.h"
@@ -178,7 +179,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
WebCore::HTMLFrameOwnerElement* ownerFrameElement,
- const WebCore::String& frameName)
+ const WTF::String& frameName)
: name(frameName)
, ownerElement(ownerFrameElement)
, page(parentPage)
@@ -753,7 +754,7 @@ void QWebFrame::load(const QNetworkRequest &req,
case QNetworkAccessManager::PostOperation:
request.setHTTPMethod("POST");
break;
-#if QT_VERSION >= 0x040600
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QNetworkAccessManager::DeleteOperation:
request.setHTTPMethod("DELETE");
break;
@@ -808,7 +809,7 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
WebCore::ResourceRequest request(kurl);
const QByteArray utf8 = html.toUtf8();
WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length());
- WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), KURL());
+ WebCore::SubstituteData substituteData(data, WTF::String("text/html"), WTF::String("utf-8"), KURL());
d->frame->loader()->load(request, substituteData, false);
}
@@ -830,10 +831,15 @@ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, cons
KURL kurl(baseUrl);
WebCore::ResourceRequest request(kurl);
WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(data.constData(), data.length());
- QString actualMimeType = mimeType;
- if (actualMimeType.isEmpty())
+ QString actualMimeType;
+ WTF::String encoding;
+ if (mimeType.isEmpty())
actualMimeType = QLatin1String("text/html");
- WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), KURL());
+ else {
+ actualMimeType = extractMIMETypeFromMediaType(mimeType);
+ encoding = extractCharsetFromMediaType(mimeType);
+ }
+ WebCore::SubstituteData substituteData(buffer, WTF::String(actualMimeType), encoding, KURL());
d->frame->loader()->load(request, substituteData, false);
}