Foo::s_info should be Foo::info(), so that you can change how the s_info is actually...
[WebKit-https.git] / Source / WebKit / qt / WebCoreSupport / DumpRenderTreeSupportQt.cpp
index d6fa627..3df5597 100644 (file)
@@ -2,7 +2,7 @@
     Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
     Copyright (C) 2008,2009,2010 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2007 Staikos Computing Services Inc.
-    Copyright (C) 2007 Apple Inc.
+    Copyright (C) 2007, 2012 Apple Inc.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -25,7 +25,6 @@
 
 #include "APICast.h"
 #include "ApplicationCacheStorage.h"
-#include "CSSComputedStyleDeclaration.h"
 #include "ChromeClientQt.h"
 #include "ContainerNode.h"
 #include "ContextMenu.h"
 #include "EditorClientQt.h"
 #include "Element.h"
 #include "FocusController.h"
+#include "Font.h"
 #include "Frame.h"
+#include "FrameLoadRequest.h"
 #include "FrameLoaderClientQt.h"
 #include "FrameView.h"
 #include "GCController.h"
-#include "JSNode.h"
-#include "qt_runtime.h"
 #include "GeolocationClient.h"
 #include "GeolocationClientMock.h"
 #include "GeolocationController.h"
@@ -53,8 +52,8 @@
 #include "HTMLFormElement.h"
 #include "HTMLInputElement.h"
 #include "HistoryItem.h"
-#include "InitWebCoreQt.h"
 #include "InspectorController.h"
+#include "JSNode.h"
 #include "NodeList.h"
 #include "NotificationPresenterClientQt.h"
 #include "Page.h"
 #include "PluginView.h"
 #include "PositionError.h"
 #include "PrintContext.h"
+#include "QWebFrameAdapter.h"
+#include "QWebPageAdapter.h"
 #include "RenderListItem.h"
 #include "RenderTreeAsText.h"
+#include "RuntimeEnabledFeatures.h"
 #include "SchemeRegistry.h"
 #include "ScriptController.h"
 #include "ScriptSourceCode.h"
 #include "TextIterator.h"
 #include "ThirdPartyCookiesQt.h"
 #include "WebCoreTestSupport.h"
-#include "WorkerThread.h"
-#include <wtf/CurrentTime.h>
-
+#include "qt_runtime.h"
 #include "qwebelement.h"
-#include "qwebframe.h"
-#include "qwebframe_p.h"
 #include "qwebhistory.h"
 #include "qwebhistory_p.h"
-#include "qwebpage.h"
-#include "qwebpage_p.h"
 #include "qwebscriptworld.h"
 
 #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
@@ -92,9 +88,8 @@
 #include "MediaPlayerPrivateQt.h"
 #endif
 
-#include <QAction>
-#include <QMenu>
 #include <QPainter>
+#include <wtf/CurrentTime.h>
 
 using namespace WebCore;
 
@@ -103,15 +98,15 @@ QMap<int, QWebScriptWorld*> m_worldMap;
 #if ENABLE(GEOLOCATION)
 GeolocationClientMock* toGeolocationClientMock(GeolocationClient* client)
 {
-     ASSERT(QWebPagePrivate::drtRun);
-     return static_cast<GeolocationClientMock*>(client);
+    ASSERT(QWebPageAdapter::drtRun);
+    return static_cast<GeolocationClientMock*>(client);
 }
 #endif
 
 #if ENABLE(DEVICE_ORIENTATION)
 DeviceOrientationClientMock* toDeviceOrientationClientMock(DeviceOrientationClient* client)
 {
-    ASSERT(QWebPagePrivate::drtRun);
+    ASSERT(QWebPageAdapter::drtRun);
     return static_cast<DeviceOrientationClientMock*>(client);
 }
 #endif
@@ -166,9 +161,9 @@ WebCore::Node* QtDRTNodeRuntime::get(const QDRTNode& node)
     return node.m_node;
 }
 
-static QVariant convertJSValueToNodeVariant(JSC::JSObject* object, int *distance, HashSet<JSC::JSObject*>*)
+static QVariant convertJSValueToNodeVariant(JSC::JSObject* object, int *distance, HashSet<JSObjectRef>*)
 {
-    if (!object || !object->inherits(&JSNode::s_info))
+    if (!object || !object->inherits(JSNode::info()))
         return QVariant();
     return QVariant::fromValue<QDRTNode>(QtDRTNodeRuntime::create((static_cast<JSNode*>(object))->impl()));
 }
@@ -198,7 +193,6 @@ DumpRenderTreeSupportQt::~DumpRenderTreeSupportQt()
 
 void DumpRenderTreeSupportQt::initialize()
 {
-    WebCore::initializeWebCoreQt();
     QtDRTNodeRuntime::initialize();
 }
 
@@ -214,86 +208,60 @@ void DumpRenderTreeSupportQt::overwritePluginDirectories()
     db->refresh();
 }
 
-int DumpRenderTreeSupportQt::workerThreadCount()
-{
-#if ENABLE(WORKERS)
-    return WebCore::WorkerThread::workerThreadCount();
-#else
-    return 0;
-#endif
-}
-
 void DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(bool b)
 {
-    QWebPagePrivate::drtRun = b;
+    QWebPageAdapter::drtRun = b;
 #if ENABLE(NETSCAPE_PLUGIN_API) && defined(XP_UNIX)
     // PluginViewQt (X11) needs a few workarounds when running under DRT
     PluginView::setIsRunningUnderDRT(b);
 #endif
 }
 
-void DumpRenderTreeSupportQt::setFrameFlatteningEnabled(QWebPage* page, bool enabled)
+void DumpRenderTreeSupportQt::setFrameFlatteningEnabled(QWebPageAdapter* adapter, bool enabled)
 {
-    QWebPagePrivate::core(page)->settings()->setFrameFlatteningEnabled(enabled);
+    adapter->page->settings().setFrameFlatteningEnabled(enabled);
 }
 
-void DumpRenderTreeSupportQt::setMockScrollbarsEnabled(QWebPage* page, bool enabled)
+void DumpRenderTreeSupportQt::webPageSetGroupName(QWebPageAdapter *adapter, const QString& groupName)
 {
-    QWebPagePrivate::core(page)->settings()->setMockScrollbarsEnabled(enabled);
+    adapter->page->setGroupName(groupName);
 }
 
-void DumpRenderTreeSupportQt::webPageSetGroupName(QWebPage* page, const QString& groupName)
+QString DumpRenderTreeSupportQt::webPageGroupName(QWebPageAdapter* adapter)
 {
-    page->handle()->page->setGroupName(groupName);
+    return adapter->page->groupName();
 }
 
-QString DumpRenderTreeSupportQt::webPageGroupName(QWebPage* page)
-{
-    return page->handle()->page->groupName();
-}
-
-void DumpRenderTreeSupportQt::webInspectorExecuteScript(QWebPage* page, long callId, const QString& script)
+void DumpRenderTreeSupportQt::webInspectorExecuteScript(QWebPageAdapter* adapter, long callId, const QString& script)
 {
 #if ENABLE(INSPECTOR)
-    if (!page->handle()->page->inspectorController())
+    if (!adapter->page->inspectorController())
         return;
-    page->handle()->page->inspectorController()->evaluateForTestInFrontend(callId, script);
+    adapter->page->inspectorController()->evaluateForTestInFrontend(callId, script);
 #endif
 }
 
-void DumpRenderTreeSupportQt::webInspectorClose(QWebPage* page)
+void DumpRenderTreeSupportQt::webInspectorShow(QWebPageAdapter* adapter)
 {
 #if ENABLE(INSPECTOR)
-    if (!page->handle()->page->inspectorController())
+    if (!adapter->page->inspectorController())
         return;
-    page->handle()->page->inspectorController()->close();
+    adapter->page->inspectorController()->show();
 #endif
 }
 
-void DumpRenderTreeSupportQt::webInspectorShow(QWebPage* page)
+void DumpRenderTreeSupportQt::webInspectorClose(QWebPageAdapter* adapter)
 {
 #if ENABLE(INSPECTOR)
-    if (!page->handle()->page->inspectorController())
+    if (!adapter->page->inspectorController())
         return;
-    page->handle()->page->inspectorController()->show();
+    adapter->page->inspectorController()->close();
 #endif
 }
 
-bool DumpRenderTreeSupportQt::hasDocumentElement(QWebFrame* frame)
+bool DumpRenderTreeSupportQt::hasDocumentElement(QWebFrameAdapter *adapter)
 {
-    return QWebFramePrivate::core(frame)->document()->documentElement();
-}
-
-void DumpRenderTreeSupportQt::setAutofilled(const QWebElement& element, bool isAutofilled)
-{
-    WebCore::Element* webElement = element.m_element;
-    if (!webElement)
-        return;
-    HTMLInputElement* inputElement = webElement->toInputElement();
-    if (!inputElement)
-        return;
-
-    inputElement->setAutofilled(isAutofilled);
+    return adapter->frame->document()->documentElement();
 }
 
 void DumpRenderTreeSupportQt::setValueForUser(const QWebElement& element, const QString& value)
@@ -308,72 +276,15 @@ void DumpRenderTreeSupportQt::setValueForUser(const QWebElement& element, const
     inputElement->setValueForUser(value);
 }
 
-// Pause a given CSS animation or transition on the target node at a specific time.
-// If the animation or transition is already paused, it will update its pause time.
-// This method is only intended to be used for testing the CSS animation and transition system.
-bool DumpRenderTreeSupportQt::pauseAnimation(QWebFrame *frame, const QString &animationName, double time, const QString &elementId)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return false;
-
-    AnimationController* controller = coreFrame->animation();
-    if (!controller)
-        return false;
-
-    Document* doc = coreFrame->document();
-    Q_ASSERT(doc);
-
-    Node* coreNode = doc->getElementById(elementId);
-    if (!coreNode || !coreNode->renderer())
-        return false;
-
-    return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time);
-}
-
-bool DumpRenderTreeSupportQt::pauseTransitionOfProperty(QWebFrame *frame, const QString &propertyName, double time, const QString &elementId)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return false;
-
-    AnimationController* controller = coreFrame->animation();
-    if (!controller)
-        return false;
-
-    Document* doc = coreFrame->document();
-    Q_ASSERT(doc);
-
-    Node* coreNode = doc->getElementById(elementId);
-    if (!coreNode || !coreNode->renderer())
-        return false;
-
-    return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time);
-}
-
-// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
-int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
+void DumpRenderTreeSupportQt::clearFrameName(QWebFrameAdapter *adapter)
 {
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return false;
-
-    AnimationController* controller = coreFrame->animation();
-    if (!controller)
-        return false;
-
-    return controller->numberOfActiveAnimations(coreFrame->document());
-}
-
-void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
+    Frame* coreFrame = adapter->frame;
     coreFrame->tree()->clearName();
 }
 
 int DumpRenderTreeSupportQt::javaScriptObjectsCount()
 {
-    return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount();
+    return JSDOMWindowBase::commonVM()->heap.globalObjectCount();
 }
 
 void DumpRenderTreeSupportQt::garbageCollectorCollect()
@@ -386,46 +297,6 @@ void DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(bool wait
     gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
 }
 
-int DumpRenderTreeSupportQt::pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return -1;
-
-    Element* element = coreFrame->document()->getElementById(AtomicString(id));
-    if (!element)
-        return -1;
-
-    return PrintContext::pageNumberForElement(element, FloatSize(width, height));
-}
-
-int DumpRenderTreeSupportQt::numberOfPages(QWebFrame* frame, float width, float height)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return -1;
-
-    return PrintContext::numberOfPages(coreFrame, FloatSize(width, height));
-}
-
-// Suspend active DOM objects in this frame.
-void DumpRenderTreeSupportQt::suspendActiveDOMObjects(QWebFrame* frame)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (coreFrame->document())
-        // FIXME: This function should be changed take a ReasonForSuspension parameter 
-        // https://bugs.webkit.org/show_bug.cgi?id=45732
-        coreFrame->document()->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
-}
-
-// Resume active DOM objects in this frame.
-void DumpRenderTreeSupportQt::resumeActiveDOMObjects(QWebFrame* frame)
-{
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (coreFrame->document())
-        coreFrame->document()->resumeActiveDOMObjects();
-}
-
 void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 {
     SecurityPolicy::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
@@ -446,113 +317,29 @@ void DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(bool forb
     SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
 }
 
-void DumpRenderTreeSupportQt::setCaretBrowsingEnabled(QWebPage* page, bool value)
-{
-    page->handle()->page->settings()->setCaretBrowsingEnabled(value);
-}
-
-void DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(QWebPage* page, bool value)
-{
-    page->handle()->page->settings()->setAuthorAndUserStylesEnabled(value);
-}
-
-void DumpRenderTreeSupportQt::setMediaType(QWebFrame* frame, const QString& type)
-{
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
-    WebCore::FrameView* view = coreFrame->view();
-    view->setMediaType(type);
-    coreFrame->document()->styleResolverChanged(RecalcStyleImmediately);
-    view->layout();
-}
-
-void DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(QWebPage* page, bool enabled)
-{
-    page->d->smartInsertDeleteEnabled = enabled;
-}
-
-
-void DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled)
-{
-    page->d->selectTrailingWhitespaceEnabled = enabled;
-}
-
-
-void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value)
-{
-    page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
-}
-
-bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& name)
-{
-    return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
-}
-
-bool DumpRenderTreeSupportQt::findString(QWebPage* page, const QString& string, const QStringList& optionArray)
+void DumpRenderTreeSupportQt::setCaretBrowsingEnabled(QWebPageAdapter* adapter, bool value)
 {
-    // 1. Parse the options from the array
-    WebCore::FindOptions options = 0;
-    const int optionCount = optionArray.size();
-    for (int i = 0; i < optionCount; ++i) {
-        const QString& option = optionArray.at(i);
-        if (option == QLatin1String("CaseInsensitive"))
-            options |= WebCore::CaseInsensitive;
-        else if (option == QLatin1String("AtWordStarts"))
-            options |= WebCore::AtWordStarts;
-        else if (option == QLatin1String("TreatMedialCapitalAsWordStart"))
-            options |= WebCore::TreatMedialCapitalAsWordStart;
-        else if (option == QLatin1String("Backwards"))
-            options |= WebCore::Backwards;
-        else if (option == QLatin1String("WrapAround"))
-            options |= WebCore::WrapAround;
-        else if (option == QLatin1String("StartInSelection"))
-            options |= WebCore::StartInSelection;
-    }
-
-    // 2. find the string
-    WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
-    return frame && frame->editor()->findString(string, options);
+    adapter->page->settings().setCaretBrowsingEnabled(value);
 }
 
-QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listItem)
+void DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(QWebPageAdapter* adapter, bool value)
 {
-    return WebCore::markerTextForListItem(listItem.m_element);
+    adapter->page->settings().setAuthorAndUserStylesEnabled(value);
 }
 
-static QString convertToPropertyName(const QString& name)
+void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPageAdapter* adapter, const QString& name, const QString& value)
 {
-    QStringList parts = name.split(QLatin1Char('-'));
-    QString camelCaseName;
-    for (int j = 0; j < parts.count(); ++j) {
-        QString part = parts.at(j);
-        if (j)
-            camelCaseName.append(part.replace(0, 1, part.left(1).toUpper()));
-        else
-            camelCaseName.append(part);
-    }
-    return camelCaseName;
+    adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
 }
 
-QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element)
+bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPageAdapter *adapter, const QString& name)
 {
-    QVariantMap res;
-
-    WebCore::Element* webElement = element.m_element;
-    if (!webElement)
-        return res;
-
-    RefPtr<WebCore::CSSComputedStyleDeclaration> computedStyleDeclaration = CSSComputedStyleDeclaration::create(webElement, true);
-    CSSStyleDeclaration* style = static_cast<WebCore::CSSStyleDeclaration*>(computedStyleDeclaration.get());
-    for (unsigned i = 0; i < style->length(); i++) {
-        QString name = style->item(i);
-        QString value = style->getPropertyValue(name);
-        res[convertToPropertyName(name)] = QVariant(value);
-    }
-    return res;
+    return adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
 }
 
-QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPage* page)
+QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPageAdapter *adapter)
 {
-    WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
     QVariantList selectedRange;
     RefPtr<Range> range = frame->selection()->toNormalizedRange().get();
 
@@ -574,9 +361,9 @@ QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPage* page)
 
 }
 
-QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPage* page, int location, int length)
+QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPageAdapter *adapter, int location, int length)
 {
-    WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
     QVariantList rect;
 
     if ((location + length < location) && (location + length))
@@ -587,35 +374,17 @@ QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPage* page,
     if (!range)
         return QVariantList();
 
-    QRect resultRect = frame->editor()->firstRectForRange(range.get());
+    QRect resultRect = frame->editor().firstRectForRange(range.get());
     rect << resultRect.x() << resultRect.y() << resultRect.width() << resultRect.height();
     return rect;
 }
 
-bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId)
+void DumpRenderTreeSupportQt::setWindowsBehaviorAsEditingBehavior(QWebPageAdapter* adapter)
 {
-    Frame* coreFrame = QWebFramePrivate::core(frame);
-    if (!coreFrame)
-        return false;
-
-    Document* doc = coreFrame->document();
-    Q_ASSERT(doc);
-
-    Node* coreNode = doc->getElementById(elementId);
-    if (!coreNode || !coreNode->renderer())
-        return false;
-
-    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
-
-    return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
-}
-
-void DumpRenderTreeSupportQt::setWindowsBehaviorAsEditingBehavior(QWebPage* page)
-{
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     if (!corePage)
         return;
-    corePage->settings()->setEditingBehaviorType(EditingWindowsBehavior);
+    corePage->settings().setEditingBehaviorType(EditingWindowsBehavior);
 }
 
 void DumpRenderTreeSupportQt::clearAllApplicationCaches()
@@ -712,98 +481,88 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b)
 #endif
 }
 
-QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, int deviceDPI, const QSize& deviceSize, const QSize& availableSize)
+QString DumpRenderTreeSupportQt::viewportAsText(QWebPageAdapter* adapter, int deviceDPI, const QSize& deviceSize, const QSize& availableSize)
 {
-    WebCore::ViewportArguments args = page->d->viewportArguments();
+    WebCore::ViewportArguments args = adapter->viewportArguments();
 
+    float devicePixelRatio = deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI;
     WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(args,
-        /* desktop-width    */ 980,
-        /* device-width     */ deviceSize.width(),
-        /* device-height    */ deviceSize.height(),
-        /* devicePixelRatio */ deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI,
+        /* desktop-width    */980,
+        /* device-width     */deviceSize.width(),
+        /* device-height    */deviceSize.height(),
+        devicePixelRatio,
         availableSize);
-    WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize);
+    WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize, devicePixelRatio);
     WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf);
 
     QString res;
     res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
-            static_cast<int>(conf.layoutSize.width()),
-            static_cast<int>(conf.layoutSize.height()),
-            conf.initialScale,
-            conf.minimumScale,
-            conf.maximumScale,
-            conf.userScalable);
+        static_cast<int>(conf.layoutSize.width()),
+        static_cast<int>(conf.layoutSize.height()),
+        conf.initialScale,
+        conf.minimumScale,
+        conf.maximumScale,
+        conf.userScalable);
 
     return res;
 }
 
-void DumpRenderTreeSupportQt::scalePageBy(QWebFrame* frame, float scalefactor, const QPoint& origin)
+void DumpRenderTreeSupportQt::scalePageBy(QWebFrameAdapter* adapter, float scalefactor, const QPoint& origin)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     if (Page* page = coreFrame->page())
         page->setPageScaleFactor(scalefactor, origin);
 }
 
-void DumpRenderTreeSupportQt::setMockDeviceOrientation(QWebPage* page, bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void DumpRenderTreeSupportQt::setMockDeviceOrientation(QWebPageAdapter* adapter, bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
 {
 #if ENABLE(DEVICE_ORIENTATION)
-    Page* corePage = QWebPagePrivate::core(page);
-    DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(corePage)->client());
+    Page* corePage = adapter->page;
+    DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(corePage)->deviceOrientationClient());
     mockClient->setOrientation(DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma));
 #endif
 }
 
-void DumpRenderTreeSupportQt::resetGeolocationMock(QWebPage* page)
+void DumpRenderTreeSupportQt::resetGeolocationMock(QWebPageAdapter* adapter)
 {
 #if ENABLE(GEOLOCATION)
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
     mockClient->reset();
 #endif
 }
 
-void DumpRenderTreeSupportQt::setMockGeolocationPermission(QWebPage* page, bool allowed)
+void DumpRenderTreeSupportQt::setMockGeolocationPermission(QWebPageAdapter* adapter, bool allowed)
 {
 #if ENABLE(GEOLOCATION)
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
     mockClient->setPermission(allowed);
 #endif
 }
 
-void DumpRenderTreeSupportQt::setMockGeolocationPosition(QWebPage* page, double latitude, double longitude, double accuracy)
+void DumpRenderTreeSupportQt::setMockGeolocationPosition(QWebPageAdapter* adapter, double latitude, double longitude, double accuracy)
 {
 #if ENABLE(GEOLOCATION)
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
     mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy));
 #endif
 }
 
-void DumpRenderTreeSupportQt::setMockGeolocationError(QWebPage* page, int errorCode, const QString& message)
+void DumpRenderTreeSupportQt::setMockGeolocationPositionUnavailableError(QWebPageAdapter* adapter, const QString& message)
 {
 #if ENABLE(GEOLOCATION)
-    Page* corePage = QWebPagePrivate::core(page);
-
-    GeolocationError::ErrorCode code = GeolocationError::PositionUnavailable;
-    switch (errorCode) {
-    case PositionError::PERMISSION_DENIED:
-        code = GeolocationError::PermissionDenied;
-        break;
-    case PositionError::POSITION_UNAVAILABLE:
-        code = GeolocationError::PositionUnavailable;
-        break;
-    }
-
+    Page* corePage = adapter->page;
     GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage)->client());
-    mockClient->setError(GeolocationError::create(code, message));
+    mockClient->setPositionUnavailableError(message);
 #endif
 }
 
-int DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests(QWebPage* page)
+int DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests(QWebPageAdapter* adapter)
 {
 #if ENABLE(GEOLOCATION)
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
     return mockClient->numberOfPendingPermissionRequests();
 #else
@@ -840,9 +599,9 @@ QMap<QString, QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(con
     return kids;
 }
 
-bool DumpRenderTreeSupportQt::shouldClose(QWebFrame* frame)
+bool DumpRenderTreeSupportQt::shouldClose(QWebFrameAdapter *adapter)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     return coreFrame->loader()->shouldClose();
 }
 
@@ -851,7 +610,7 @@ void DumpRenderTreeSupportQt::clearScriptWorlds()
     m_worldMap.clear();
 }
 
-void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldID, const QString& script)
+void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrameAdapter *adapter, int worldID, const QString& script)
 {
     QWebScriptWorld* scriptWorld;
     if (!worldID) {
@@ -862,7 +621,7 @@ void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, in
     } else
         scriptWorld = m_worldMap.value(worldID);
 
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
 
     ScriptController* proxy = coreFrame->script();
 
@@ -871,27 +630,14 @@ void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, in
     proxy->executeScriptInWorld(scriptWorld->world(), script, true);
 }
 
-QString DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
-{
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
-    return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageIndex, width, height,
-                                                    marginTop, marginRight, marginBottom, marginLeft);
-}
-
-QString DumpRenderTreeSupportQt::pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber)
+void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPageAdapter* adapter, const QString& sourceCode)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
-    return PrintContext::pageProperty(coreFrame, propertyName.toUtf8().constData(), pageNumber);
+    adapter->page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, QUrl(), Vector<String>(), Vector<String>(), WebCore::InjectInAllFrames);
 }
 
-void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& sourceCode)
+void DumpRenderTreeSupportQt::removeUserStyleSheets(QWebPageAdapter* adapter)
 {
-    page->handle()->page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, QUrl(), nullptr, nullptr, WebCore::InjectInAllFrames);
-}
-
-void DumpRenderTreeSupportQt::removeUserStyleSheets(QWebPage* page)
-{
-    page->handle()->page->group().removeUserStyleSheetsFromWorld(mainThreadNormalWorld());
+    adapter->page->group().removeUserStyleSheetsFromWorld(mainThreadNormalWorld());
 }
 
 void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title)
@@ -901,31 +647,31 @@ void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& ti
 #endif
 }
 
-void DumpRenderTreeSupportQt::setDefersLoading(QWebPage* page, bool flag)
+void DumpRenderTreeSupportQt::setDefersLoading(QWebPageAdapter* adapter, bool flag)
 {
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     if (corePage)
         corePage->setDefersLoading(flag);
 }
 
-void DumpRenderTreeSupportQt::goBack(QWebPage* page)
+void DumpRenderTreeSupportQt::goBack(QWebPageAdapter* adapter)
 {
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     if (corePage)
         corePage->goBack();
 }
 
 // API Candidate?
-QString DumpRenderTreeSupportQt::responseMimeType(QWebFrame* frame)
+QString DumpRenderTreeSupportQt::responseMimeType(QWebFrameAdapter* adapter)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     WebCore::DocumentLoader* docLoader = coreFrame->loader()->documentLoader();
     return docLoader->responseMIMEType();
 }
 
-void DumpRenderTreeSupportQt::clearOpener(QWebFrame* frame)
+void DumpRenderTreeSupportQt::clearOpener(QWebFrameAdapter* adapter)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     coreFrame->loader()->setOpener(0);
 }
 
@@ -934,70 +680,35 @@ void DumpRenderTreeSupportQt::addURLToRedirect(const QString& origin, const QStr
     FrameLoaderClientQt::URLsToRedirect[origin] = destination;
 }
 
-void DumpRenderTreeSupportQt::setInteractiveFormValidationEnabled(QWebPage* page, bool enable)
+void DumpRenderTreeSupportQt::setInteractiveFormValidationEnabled(QWebPageAdapter* adapter, bool enable)
 {
-    Page* corePage = QWebPagePrivate::core(page);
+    Page* corePage = adapter->page;
     if (corePage)
-        corePage->settings()->setInteractiveFormValidationEnabled(enable);
-}
-
-#ifndef QT_NO_MENU
-static QStringList iterateContextMenu(QMenu* menu)
-{
-    if (!menu)
-        return QStringList();
-
-    QStringList items;
-    QList<QAction *> actions = menu->actions();
-    for (int i = 0; i < actions.count(); ++i) {
-        if (actions.at(i)->isSeparator())
-            items << QLatin1String("<separator>");
-        else
-            items << actions.at(i)->text();
-        if (actions.at(i)->menu())
-            items << iterateContextMenu(actions.at(i)->menu());
-    }
-    return items;
+        corePage->settings().setInteractiveFormValidationEnabled(enable);
 }
-#endif
 
-QStringList DumpRenderTreeSupportQt::contextMenu(QWebPage* page)
+QStringList DumpRenderTreeSupportQt::contextMenu(QWebPageAdapter* page)
 {
-#ifndef QT_NO_CONTEXTMENU
-    return iterateContextMenu(page->d->currentContextMenu.data());
-#else
-    return QStringList();
-#endif
+    return page->menuActionsAsText();
 }
 
-double DumpRenderTreeSupportQt::defaultMinimumTimerInterval()
+bool DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows(QWebPageAdapter *adapter, const QUrl& url, const QUrl& firstPartyUrl)
 {
-    return Settings::defaultMinDOMTimerInterval();
-}
-
-void DumpRenderTreeSupportQt::setMinimumTimerInterval(QWebPage* page, double interval)
-{
-    Page* corePage = QWebPagePrivate::core(page);
-    if (!corePage)
-        return;
-
-    corePage->settings()->setMinDOMTimerInterval(interval);
+    Page* corePage = adapter->page;
+    return thirdPartyCookiePolicyPermits(corePage->mainFrame()->loader()->networkingContext(), url, firstPartyUrl);
 }
 
-#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
-bool DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows(QWebPage *page, const QUrl& url, const QUrl& firstPartyUrl)
+void DumpRenderTreeSupportQt::enableMockScrollbars()
 {
-    Page* corePage = QWebPagePrivate::core(page);
-    return thirdPartyCookiePolicyPermits(corePage->mainFrame()->loader()->networkingContext(), url, firstPartyUrl);
+    Settings::setMockScrollbarsEnabled(true);
 }
-#endif
 
-QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const QString& elementId)
+QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrameAdapter* adapter, const QString& elementId)
 {
     QUrl res;
 
 #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
-    Frame* coreFrame = QWebFramePrivate::core(frame);
+    Frame* coreFrame = adapter->frame;
     if (!coreFrame)
         return res;
 
@@ -1009,7 +720,7 @@ QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const
     if (!coreNode)
         return res;
 
-    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(coreNode);
+    HTMLVideoElement* videoElement = toHTMLVideoElement(coreNode);
     PlatformMedia platformMedia = videoElement->platformMedia();
     if (platformMedia.type != PlatformMedia::QtMediaPlayerType)
         return res;
@@ -1023,45 +734,39 @@ QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const
 }
 
 // API Candidate?
-void DumpRenderTreeSupportQt::setAlternateHtml(QWebFrame* frame, const QString& html, const QUrl& baseUrl, const QUrl& failingUrl)
+void DumpRenderTreeSupportQt::setAlternateHtml(QWebFrameAdapter* adapter, const QString& html, const QUrl& baseUrl, const QUrl& failingUrl)
 {
     KURL kurl(baseUrl);
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->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);
+    coreFrame->loader()->load(WebCore::FrameLoadRequest(coreFrame, request, substituteData));
 }
 
-void DumpRenderTreeSupportQt::confirmComposition(QWebPage* page, const char* text)
+void DumpRenderTreeSupportQt::confirmComposition(QWebPageAdapter *adapter, const char* text)
 {
-    Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
+    Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
     if (!frame)
         return;
 
-    Editor* editor = frame->editor();
-    if (!editor || (!editor->hasComposition() && !text))
+    Editor& editor = frame->editor();
+    if (!editor.hasComposition() && !text)
         return;
 
-    if (editor->hasComposition()) {
+    if (editor.hasComposition()) {
         if (text)
-            editor->confirmComposition(String::fromUTF8(text));
+            editor.confirmComposition(String::fromUTF8(text));
         else
-            editor->confirmComposition();
+            editor.confirmComposition();
     } else
-        editor->insertText(String::fromUTF8(text), 0);
-}
-
-QString DumpRenderTreeSupportQt::layerTreeAsText(QWebFrame* frame)
-{
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
-    return coreFrame->layerTreeAsText();
+        editor.insertText(String::fromUTF8(text), 0);
 }
 
-void DumpRenderTreeSupportQt::injectInternalsObject(QWebFrame* frame)
+void DumpRenderTreeSupportQt::injectInternalsObject(QWebFrameAdapter* adapter)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     JSDOMWindow* window = toJSDOMWindow(coreFrame, mainThreadNormalWorld());
     Q_ASSERT(window);
 
@@ -1078,9 +783,9 @@ void DumpRenderTreeSupportQt::injectInternalsObject(JSContextRef context)
     WebCoreTestSupport::injectInternalsObject(context);
 }
 
-void DumpRenderTreeSupportQt::resetInternalsObject(QWebFrame* frame)
+void DumpRenderTreeSupportQt::resetInternalsObject(QWebFrameAdapter* adapter)
 {
-    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::Frame* coreFrame = adapter->frame;
     JSDOMWindow* window = toJSDOMWindow(coreFrame, mainThreadNormalWorld());
     Q_ASSERT(window);
 
@@ -1092,9 +797,14 @@ void DumpRenderTreeSupportQt::resetInternalsObject(QWebFrame* frame)
     WebCoreTestSupport::resetInternalsObject(context);
 }
 
-QImage DumpRenderTreeSupportQt::paintPagesWithBoundaries(QWebFrame* qframe)
+void DumpRenderTreeSupportQt::resetInternalsObject(JSContextRef context)
 {
-    Frame* frame = QWebFramePrivate::core(qframe);
+    WebCoreTestSupport::resetInternalsObject(context);
+}
+
+QImage DumpRenderTreeSupportQt::paintPagesWithBoundaries(QWebFrameAdapter* adapter)
+{
+    Frame* frame = adapter->frame;
     PrintContext printContext(frame);
 
     QRect rect = frame->view()->frameRect();
@@ -1135,100 +845,62 @@ QImage DumpRenderTreeSupportQt::paintPagesWithBoundaries(QWebFrame* qframe)
     return image;
 }
 
-// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
-
-void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
-{
-    DumpRenderTreeSupportQt::resumeActiveDOMObjects(frame);
-}
-
-void QWEBKIT_EXPORT qt_suspendActiveDOMObjects(QWebFrame* frame)
-{
-    DumpRenderTreeSupportQt::suspendActiveDOMObjects(frame);
-}
-
-void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* frame)
-{
-    DumpRenderTreeSupportQt::clearFrameName(frame);
-}
-
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collect()
-{
-    DumpRenderTreeSupportQt::garbageCollectorCollect();
-}
-
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone)
+void DumpRenderTreeSupportQt::setTrackRepaintRects(QWebFrameAdapter* adapter, bool enable)
 {
-    DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(waitUntilDone);
+    adapter->frame->view()->setTracksRepaints(enable);
 }
 
-int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount()
+bool DumpRenderTreeSupportQt::trackRepaintRects(QWebFrameAdapter* adapter)
 {
-    return DumpRenderTreeSupportQt::javaScriptObjectsCount();
+    return adapter->frame->view()->isTrackingRepaints();
 }
 
-int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame* frame)
+void DumpRenderTreeSupportQt::getTrackedRepaintRects(QWebFrameAdapter* adapter, QVector<QRect>& result)
 {
-    return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
+    Frame* coreFrame = adapter->frame;
+    const Vector<IntRect>& rects = coreFrame->view()->trackedRepaintRects();
+    result.resize(rects.size());
+    for (size_t i = 0; i < rects.size(); ++i)
+        result.append(rects[i]);
 }
 
-void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
+void DumpRenderTreeSupportQt::setSeamlessIFramesEnabled(bool enabled)
 {
-    DumpRenderTreeSupportQt::overwritePluginDirectories();
-}
-
-bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame* frame, const QString& animationName, double time, const QString& elementId)
-{
-    return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId);
-}
-
-bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame* frame, const QString& propertyName, double time, const QString &elementId)
-{
-    return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId);
-}
-
-void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists()
-{
-    DumpRenderTreeSupportQt::resetOriginAccessWhiteLists();
-}
-
-void QWEBKIT_EXPORT qt_drt_run(bool b)
-{
-    DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(b);
+#if ENABLE(IFRAME_SEAMLESS)
+    WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
 }
 
-void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void DumpRenderTreeSupportQt::setShouldUseFontSmoothing(bool enabled)
 {
-    DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+    WebCore::Font::setShouldUseSmoothing(enabled);
 }
 
-QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
+QString DumpRenderTreeSupportQt::frameRenderTreeDump(QWebFrameAdapter* adapter)
 {
-    return DumpRenderTreeSupportQt::webPageGroupName(page);
-}
+    if (adapter->frame->view() && adapter->frame->view()->layoutPending())
+        adapter->frame->view()->layout();
 
-void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName)
-{
-    DumpRenderTreeSupportQt::webPageSetGroupName(page, groupName);
+    return externalRepresentation(adapter->frame);
 }
 
-void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
+void DumpRenderTreeSupportQt::clearNotificationPermissions()
 {
-    DumpRenderTreeSupportQt::dumpFrameLoader(b);
-}
-
-void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b)
-{
-    DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(b);
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+    WebCore::NotificationPresenterClientQt::notificationPresenter()->clearCachedPermissions();
+#endif
 }
 
-void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
+void DumpRenderTreeSupportQt::disableDefaultTypesettingFeatures()
 {
-    DumpRenderTreeSupportQt::dumpEditingCallbacks(b);
+    WebCore::Font::setDefaultTypesettingFeatures(0);
 }
 
-void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
+void DumpRenderTreeSupportQt::getJSWindowObject(QWebFrameAdapter* adapter, JSContextRef* context, JSObjectRef* object)
 {
-    DumpRenderTreeSupportQt::dumpSetAcceptsEditing(b);
+    JSDOMWindow* window = toJSDOMWindow(adapter->frame, mainThreadNormalWorld());
+    *object = toRef(window);
+    *context = toRef(window->globalExec());
 }
-