summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/Api/qwebframe.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebKit/qt/Api/qwebframe.cpp
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebKit/qt/Api/qwebframe.cpp')
-rw-r--r--WebKit/qt/Api/qwebframe.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 3eba058..c42cfa3 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -71,6 +71,8 @@
#include "qwebpage_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
+#include "qwebscriptworld.h"
+#include "qwebscriptworld_p.h"
#include "runtime_object.h"
#include "runtime_root.h"
#include "wtf/HashMap.h"
@@ -1272,8 +1274,8 @@ void QWebFrame::print(QPrinter *printer) const
if (!painter.begin(printer))
return;
- const qreal zoomFactorX = printer->logicalDpiX() / qt_defaultDpi();
- const qreal zoomFactorY = printer->logicalDpiY() / qt_defaultDpi();
+ const qreal zoomFactorX = (qreal)printer->logicalDpiX() / qt_defaultDpi();
+ const qreal zoomFactorY = (qreal)printer->logicalDpiY() / qt_defaultDpi();
PrintContext printContext(d->frame);
float pageHeight = 0;
@@ -1376,6 +1378,22 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
return rc;
}
+QVariant QWebFrame::evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource)
+{
+ ScriptController *proxy = d->frame->script();
+ QVariant rc;
+
+ if (proxy) {
+ JSC::JSValue v = proxy->executeScriptInWorld(scriptWorld->world(), scriptSource, true).jsValue();
+ if (!d->frame) // In case the script removed our frame from the page.
+ return QString();
+ int distance = 0;
+ rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
+ }
+ return rc;
+}
+
+
/*!
\since 4.5