summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt/Api/qwebframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/qt/Api/qwebframe.cpp')
-rw-r--r--Source/WebKit/qt/Api/qwebframe.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index dac4165e9..52b97382d 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -97,10 +97,6 @@
#include <qregion.h>
#include <qnetworkrequest.h>
-#if ENABLE(ORIENTATION_EVENTS) && !HAVE(QT5)
-QTM_USE_NAMESPACE
-#endif
-
using namespace WebCore;
// from text/qfont.cpp
@@ -492,45 +488,9 @@ void QWebFramePrivate::_q_orientationChanged()
void QWebFramePrivate::didClearWindowObject()
{
- if (page->settings()->testAttribute(QWebSettings::JavascriptEnabled))
- addQtSenderToGlobalObject();
emit q->javaScriptWindowObjectCleared();
}
-static JSValueRef qtSenderCallback(JSContextRef context, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*)
-{
- QObject* sender = JSC::Bindings::QtInstance::qtSenderStack()->top();
- if (!sender)
- return JSValueMakeUndefined(context);
-
- JSC::ExecState* exec = ::toJS(context);
- RefPtr<JSC::Bindings::RootObject> rootObject = JSC::Bindings::findRootObject(exec->dynamicGlobalObject());
- JSC::JSObject* jsSender = JSC::Bindings::QtInstance::getQtInstance(sender, rootObject, JSC::Bindings::QtInstance::QtOwnership)->createRuntimeObject(exec);
- return ::toRef(jsSender);
-}
-
-void QWebFramePrivate::addQtSenderToGlobalObject()
-{
- JSDOMWindow* window = toJSDOMWindow(frame, mainThreadNormalWorld());
- Q_ASSERT(window);
-
- JSC::ExecState* exec = window->globalExec();
- Q_ASSERT(exec);
- JSC::JSLockHolder lock(exec);
-
- JSContextRef context = ::toRef(exec);
- JSRetainPtr<JSStringRef> propertyName(Adopt, JSStringCreateWithUTF8CString("__qt_sender__"));
- JSObjectRef function = JSObjectMakeFunctionWithCallback(context, propertyName.get(), qtSenderCallback);
-
- // JSC public API doesn't support setting a Getter for a property of a given object, https://bugs.webkit.org/show_bug.cgi?id=61374.
- JSC::PropertyDescriptor descriptor;
- descriptor.setGetter(::toJS(function));
- descriptor.setSetter(JSC::jsUndefined());
- descriptor.setEnumerable(false);
- descriptor.setConfigurable(false);
- window->methodTable()->defineOwnProperty(window, exec, propertyName.get()->identifier(&exec->globalData()), descriptor, false);
-}
-
/*!
\class QWebFrame
\since 4.4
@@ -650,11 +610,7 @@ QWebFrame::~QWebFrame()
The ownership of \a object is specified using \a own.
*/
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership)
-#else
-void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
-#endif
{
if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
return;