summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 19:08:45 +0100
committerSteve Block <steveblock@google.com>2011-06-08 13:51:31 +0100
commit2bde8e466a4451c7319e3a072d118917957d6554 (patch)
tree28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
parent6939c99b71d9372d14a0c74a772108052e8c48c8 (diff)
downloadexternal_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/WebCoreSupport/DumpRenderTreeSupportQt.cpp')
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index c0017a2..ba712d1 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -531,7 +531,7 @@ QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listIt
static QString convertToPropertyName(const QString& name)
{
- QStringList parts = name.split('-');
+ QStringList parts = name.split(QLatin1Char('-'));
QString camelCaseName;
for (int j = 0; j < parts.count(); ++j) {
QString part = parts.at(j);
@@ -626,11 +626,11 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString&
{
WebCore::EditingBehaviorType coreEditingBehavior;
- if (editingBehavior == "win")
+ if (editingBehavior == QLatin1String("win"))
coreEditingBehavior = EditingWindowsBehavior;
- else if (editingBehavior == "mac")
+ else if (editingBehavior == QLatin1String("mac"))
coreEditingBehavior = EditingMacBehavior;
- else if (editingBehavior == "unix")
+ else if (editingBehavior == QLatin1String("unix"))
coreEditingBehavior = EditingUnixBehavior;
else {
ASSERT_NOT_REACHED();
@@ -742,12 +742,13 @@ QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, int deviceDPI, c
availableSize);
QString res;
- res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f]\n",
+ res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
conf.layoutSize.width(),
conf.layoutSize.height(),
conf.initialScale,
conf.minimumScale,
- conf.maximumScale);
+ conf.maximumScale,
+ conf.userScalable);
return res;
}
@@ -922,10 +923,10 @@ void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& ti
QString DumpRenderTreeSupportQt::plainText(const QVariant& range)
{
QMap<QString, QVariant> map = range.toMap();
- QVariant startContainer = map.value("startContainer");
+ QVariant startContainer = map.value(QLatin1String("startContainer"));
map = startContainer.toMap();
- return map.value("innerText").toString();
+ return map.value(QLatin1String("innerText")).toString();
}
QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
@@ -949,6 +950,7 @@ QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document,
return res;
}
+// API Candidate?
QString DumpRenderTreeSupportQt::responseMimeType(QWebFrame* frame)
{
WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
@@ -1038,6 +1040,18 @@ QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const
return res;
}
+// API Candidate?
+void DumpRenderTreeSupportQt::setAlternateHtml(QWebFrame* frame, const QString& html, const QUrl& baseUrl, const QUrl& failingUrl)
+{
+ KURL kurl(baseUrl);
+ WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+ 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, WTF::String("text/html"), WTF::String("utf-8"), failingUrl);
+ coreFrame->loader()->load(request, substituteData, false);
+}
+
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)