[Qt] Remove Qt 4 specific code paths
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 12:06:52 +0000 (12:06 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 12:06:52 +0000 (12:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88161

Reviewed by Kenneth Rohde Christiansen.

.:

* Source/api.pri:
* WebKit.pro:

Source/WebCore:

* Target.pri:
* WebCore.pri:
* bridge/qt/qt_class.cpp:
(JSC::Bindings::QtClass::fallbackObject):
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtInstance::getPropertyNames):
(JSC::Bindings::QtInstance::stringValue):
(JSC::Bindings::QtField::setValueToInstance):
* bridge/qt/qt_runtime.h:
(QtConnectionObject):
* bridge/qt/qt_runtime_qt4.cpp: Removed.
* editing/qt/SmartReplaceQt.cpp: Removed.
* page/qt/EventHandlerQt.cpp:
(WebCore::EventHandler::tabsToAllFormControls):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/OpenGLShims.cpp:
(WebCore::getProcAddress):
* platform/graphics/OpenGLShims.h:
* platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
* platform/graphics/gstreamer/PlatformVideoWindowQt.cpp:
(FullScreenVideoWindow::FullScreenVideoWindow):
(FullScreenVideoWindow::keyPressEvent):
(FullScreenVideoWindow::event):
(FullScreenVideoWindow::showFullScreen):
(PlatformVideoWindow::PlatformVideoWindow):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):
(WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::releaseWindowsContext):
* platform/graphics/qt/ImageQt.cpp:
(WebCore::BitmapImage::create):
* platform/graphics/qt/SimpleFontDataQt.cpp:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext):
* platform/qt/DeviceMotionProviderQt.h:
* platform/qt/DeviceOrientationProviderQt.h:
* platform/qt/KURLQt.cpp:
(WebCore::KURL::operator QUrl):
* platform/qt/PlatformScreenQt.cpp:
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/qt/QWebPageClient.h:
(QWebPageClient):
* platform/qt/RenderThemeQt.cpp:
* platform/text/qt/TextBreakIteratorQt.cpp: Removed.
* plugins/qt/PluginContainerQt.cpp: Removed.
* plugins/qt/PluginContainerQt.h: Removed.
* plugins/qt/PluginPackageQt.cpp:
(WebCore::PluginPackage::isPluginBlacklisted):
* plugins/qt/PluginViewQt.cpp:
(WebCore::PluginView::setFocus):
(WebCore::PluginView::paintUsingXPixmap):
(WebCore::setSharedXEventFields):
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::setParentVisible):
(WebCore::PluginView::platformGetValue):
(WebCore::PluginView::invalidateRect):
(WebCore::getVisualAndColormap):
(WebCore::PluginView::platformStart):
* plugins/win/PluginViewWin.cpp:
(windowHandleForPageClient):

Source/WebKit:

* WebKit.pri:
* WebKit1.pri:
* WebKit1.pro:

Source/WebKit/qt:

* Api/qgraphicswebview.cpp:
(QGraphicsWebView::sceneEvent):
* Api/qgraphicswebview.h:
* Api/qwebframe.cpp:
* Api/qwebframe.h:
* Api/qwebframe_p.h:
* Api/qwebpage.cpp:
(QWebPage::event):
* Api/qwebpage.h:
* Api/qwebsettings.cpp:
(QWebSettings::enablePersistentStorage):
* Api/qwebview.cpp:
(QWebView::QWebView):
(QWebView::event):
* Api/qwebview.h:
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::setToolTip):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::createPlugin):
* WebCoreSupport/GeolocationClientQt.cpp:
* WebCoreSupport/GeolocationClientQt.h:
* WebCoreSupport/PageClientQt.cpp:
(createPlatformGraphicsContext3DFromWidget):
(QWebPageClient::ownerWindow):
* WebCoreSupport/WebEventConversion.cpp:
(WebCore::WebKitPlatformTouchEvent::WebKitPlatformTouchEvent):
* declarative/declarative.pro:
* declarative/plugin.cpp:
* declarative/public.pri:
* examples/platformplugin/WebPlugin.cpp:
(WebPlugin::createExtension):
* examples/platformplugin/WebPlugin.h:
(WebPlugin):
* examples/platformplugin/platformplugin.pro:
* tests/qobjectbridge/tst_qobjectbridge.cpp:
(tst_QObjectBridge::arrayObjectEnumerable):
(tst_QObjectBridge::ownership):
(tst_QObjectBridge::qObjectWrapperWithSameIdentity):
* tests/tests.pri:
* tests/util.h:

Source/WebKit2:

* UIProcess/API/qt/qquickwebview.cpp:
* UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:
(gatherAPI):
* WebKit2.pri:

Source/WTF:

* WTF.pri:
* WTF.pro:
* wtf/qt/StringQt.cpp:
(WTF::String::String):
(WTF::String::operator QString):
* wtf/qt/UtilsQt.h: Removed.
* wtf/qt/compat/QGuiApplication: Removed.
* wtf/qt/compat/qguiapplication.h: Removed.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
(WTF):
* wtf/text/StringImpl.h:
(StringImpl):

Tools:

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/EventSenderQt.cpp:
(EventSender::touchCancel):
(EventSender::sendTouchEvent):
* DumpRenderTree/qt/EventSenderQt.h:
(EventSender):
* DumpRenderTree/qt/ImageDiff.pro:
* DumpRenderTree/qt/main.cpp:
(main):
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/cookiejar.cpp:
(TestBrowserCookieJar::TestBrowserCookieJar):
* QtTestBrowser/launcherwindow.cpp:
(LauncherWindow::setDiskCache):
* qmake/configure.pri:
* qmake/mkspecs/features/default_post.prf:
* qmake/mkspecs/features/default_pre.prf:
* qmake/mkspecs/features/features.prf:
* qmake/mkspecs/features/functions.prf:
* qmake/mkspecs/features/qtwebkit.prf: Removed.
* qmake/mkspecs/features/unix/default_pre.prf:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

94 files changed:
ChangeLog
Source/WTF/ChangeLog
Source/WTF/WTF.pri
Source/WTF/WTF.pro
Source/WTF/wtf/qt/StringQt.cpp
Source/WTF/wtf/qt/UtilsQt.h [deleted file]
Source/WTF/wtf/qt/compat/QGuiApplication [deleted file]
Source/WTF/wtf/qt/compat/qguiapplication.h [deleted file]
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/StringImpl.h
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/WebCore.pri
Source/WebCore/bridge/qt/qt_class.cpp
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_runtime.h
Source/WebCore/bridge/qt/qt_runtime_qt4.cpp [deleted file]
Source/WebCore/editing/qt/SmartReplaceQt.cpp [deleted file]
Source/WebCore/page/qt/EventHandlerQt.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/OpenGLShims.cpp
Source/WebCore/platform/graphics/OpenGLShims.h
Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Source/WebCore/platform/graphics/qt/ImageQt.cpp
Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/qt/DeviceMotionProviderQt.h
Source/WebCore/platform/qt/DeviceOrientationProviderQt.h
Source/WebCore/platform/qt/KURLQt.cpp
Source/WebCore/platform/qt/PlatformScreenQt.cpp
Source/WebCore/platform/qt/QWebPageClient.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp [deleted file]
Source/WebCore/plugins/qt/PluginContainerQt.cpp [deleted file]
Source/WebCore/plugins/qt/PluginContainerQt.h [deleted file]
Source/WebCore/plugins/qt/PluginPackageQt.cpp
Source/WebCore/plugins/qt/PluginViewQt.cpp
Source/WebCore/plugins/win/PluginViewWin.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebKit.pri
Source/WebKit/WebKit1.pri
Source/WebKit/WebKit1.pro
Source/WebKit/qt/Api/qgraphicswebview.cpp
Source/WebKit/qt/Api/qgraphicswebview.h
Source/WebKit/qt/Api/qwebframe.cpp
Source/WebKit/qt/Api/qwebframe.h
Source/WebKit/qt/Api/qwebframe_p.h
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/Api/qwebpage.h
Source/WebKit/qt/Api/qwebsettings.cpp
Source/WebKit/qt/Api/qwebview.cpp
Source/WebKit/qt/Api/qwebview.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
Source/WebKit/qt/declarative/declarative.pro
Source/WebKit/qt/declarative/plugin.cpp
Source/WebKit/qt/declarative/public.pri
Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp
Source/WebKit/qt/examples/platformplugin/WebPlugin.h
Source/WebKit/qt/examples/platformplugin/platformplugin.pro
Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
Source/WebKit/qt/tests/tests.pri
Source/WebKit/qt/tests/util.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
Source/WebKit2/WebKit2.pri
Source/api.pri
Tools/ChangeLog
Tools/DumpRenderTree/qt/DumpRenderTree.pro
Tools/DumpRenderTree/qt/EventSenderQt.cpp
Tools/DumpRenderTree/qt/EventSenderQt.h
Tools/DumpRenderTree/qt/ImageDiff.pro
Tools/DumpRenderTree/qt/main.cpp
Tools/QtTestBrowser/QtTestBrowser.pro
Tools/QtTestBrowser/cookiejar.cpp
Tools/QtTestBrowser/launcherwindow.cpp
Tools/qmake/configure.pri
Tools/qmake/mkspecs/features/default_post.prf
Tools/qmake/mkspecs/features/default_pre.prf
Tools/qmake/mkspecs/features/features.prf
Tools/qmake/mkspecs/features/functions.prf
Tools/qmake/mkspecs/features/qtwebkit.prf [deleted file]
Tools/qmake/mkspecs/features/unix/default_pre.prf
WebKit.pro

index 5e8da6e7d171bd548b53dfc991726ae3370f9a5e..c69f74d3c48aa8e8d25c4ea523054a769db2400f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * Source/api.pri:
+        * WebKit.pro:
+
 2012-08-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         [EFL] Enable link prefetch
index 455ecf2f970f75f96a6659c700689e6ee45b48b6..57edec6fda2fd15716893d2f8588c09ea18e7659 100644 (file)
@@ -1,3 +1,24 @@
+2012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WTF.pri:
+        * WTF.pro:
+        * wtf/qt/StringQt.cpp:
+        (WTF::String::String):
+        (WTF::String::operator QString):
+        * wtf/qt/UtilsQt.h: Removed.
+        * wtf/qt/compat/QGuiApplication: Removed.
+        * wtf/qt/compat/qguiapplication.h: Removed.
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::~StringImpl):
+        (WTF):
+        * wtf/text/StringImpl.h:
+        (StringImpl):
+
 2012-08-06  Patrick Gansterer  <paroga@webkit.org>
 
         [WIN] Remove dependency on pthread from MachineStackMarker
index 024c7f69f43775a8a34b9df388733e9f7d9a6b7b..2cfb6f82bbe2781a4ab614a2d052ef5005ef957a 100644 (file)
@@ -8,19 +8,17 @@
 # All external modules should include WTF headers by prefixing with "wtf" (#include <wtf/some/thing.h>).
 INCLUDEPATH += $$PWD
 
-haveQt(5) {
-    mac {
-        # Mac OS does ship libicu but not the associated header files.
-        # Therefore WebKit provides adequate header files.
-        INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu
-        LIBS += -licucore
+mac {
+    # Mac OS does ship libicu but not the associated header files.
+    # Therefore WebKit provides adequate header files.
+    INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu
+    LIBS += -licucore
+} else {
+    contains(QT_CONFIG,icu) {
+        win32: LIBS += -licuin -licuuc -licudt
+        else: LIBS += -licui18n -licuuc -licudata
     } else {
-        contains(QT_CONFIG,icu) {
-            win32: LIBS += -licuin -licuuc -licudt
-            else: LIBS += -licui18n -licuuc -licudata
-        } else {
-            error("To build QtWebKit with Qt 5 you need ICU")
-        }
+        error("To build QtWebKit with Qt 5 you need ICU")
     }
 }
 
index 00dee54b59e1fe99369721a586ab5566daa54f26..d66e29560eb2b950029a6fc85d7d065e653d2fe3 100644 (file)
@@ -110,7 +110,6 @@ HEADERS += \
     PassTraits.h \
     Platform.h \
     PossiblyNull.h \
-    qt/UtilsQt.h \
     RandomNumber.h \
     RandomNumberSeed.h \
     RedBlackTree.h \
index 43c4f81f028c775bfa9e6abfb96389c5c47d96ee..ad88c03f7df4b11d0eb7bd0f50bf76c1f14eeebf 100644 (file)
@@ -37,11 +37,7 @@ String::String(const QString& qstr)
 {
     if (qstr.isNull())
         return;
-#if HAVE(QT5)
     m_impl = StringImpl::adopt(const_cast<QString&>(qstr).data_ptr());
-#else
-    m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(qstr.constData()), qstr.length());
-#endif
 }
 
 String::String(const QStringRef& ref)
@@ -56,7 +52,6 @@ String::operator QString() const
     if (!m_impl)
         return QString();
 
-#if HAVE(QT5)
     if (QStringData* qStringData = m_impl->qStringData()) {
         // The WTF string was adopted from a QString at some point, so we
         // can just adopt the QStringData like a regular QString copy.
@@ -64,7 +59,7 @@ String::operator QString() const
         QStringDataPtr qStringDataPointer = { qStringData };
         return QString(qStringDataPointer);
     }
-#endif
+
     if (is8Bit() && !m_impl->has16BitShadow()) {
         // Asking for characters() of an 8-bit string will make a 16-bit copy internally
         // in WTF::String. Since we're going to copy the data to QStringData anyways, we
diff --git a/Source/WTF/wtf/qt/UtilsQt.h b/Source/WTF/wtf/qt/UtilsQt.h
deleted file mode 100644 (file)
index 61c9e32..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-    Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef WTF_UtilsQt_h
-#define WTF_UtilsQt_h
-
-#include <QString>
-#if !HAVE(QT5)
-#include <QTextDocument>
-#endif
-
-inline QString escapeHtml(const QString& string)
-{
-#if HAVE(QT5)
-    return string.toHtmlEscaped();
-#else
-    return Qt::escape(string);
-#endif
-}
-
-#endif // WTF_UtilsQt_h
diff --git a/Source/WTF/wtf/qt/compat/QGuiApplication b/Source/WTF/wtf/qt/compat/QGuiApplication
deleted file mode 100644 (file)
index 0337e25..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "qguiapplication.h"
diff --git a/Source/WTF/wtf/qt/compat/qguiapplication.h b/Source/WTF/wtf/qt/compat/qguiapplication.h
deleted file mode 100644 (file)
index 2a2fc23..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-    Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef qguiapplication_h
-#define qguiapplication_h
-
-#include <QApplication>
-
-struct QGuiApplication : public QApplication
-{
-    // Style hints in Qt 5 contain stuff that just used to be in QApplication in Qt 4, hence
-    // this hack.
-    static QApplication* styleHints()
-    {
-        return qApp;
-    }
-};
-
-#endif
index e1064b3b369c08f36b4d6402ae30bab79e38228b..f82b59de1dfd8597a94750ac748e540af00279d9 100644 (file)
@@ -69,7 +69,7 @@ StringImpl::~StringImpl()
         fastFree(const_cast<LChar*>(m_data8));
         return;
     }
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
     if (ownership == BufferAdoptedQString) {
         if (!m_qStringData->ref.deref())
             QStringData::deallocate(m_qStringData);
@@ -1657,7 +1657,7 @@ PassRefPtr<StringImpl> StringImpl::adopt(StringBuffer<UChar>& buffer)
     return adoptRef(new StringImpl(buffer.release(), length));
 }
 
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
 PassRefPtr<StringImpl> StringImpl::adopt(QStringData* qStringData)
 {
     ASSERT(qStringData);
index e709869860e47b5ab4265d9d6c1c313ae6919402..d232e2ceaf24f8d79e61875eb672e549979a222f 100644 (file)
@@ -31,7 +31,7 @@
 #include <wtf/Vector.h>
 #include <wtf/unicode/Unicode.h>
 
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
 #include <QString>
 #endif
 
@@ -88,7 +88,7 @@ private:
         BufferInternal,
         BufferOwned,
         BufferSubstring,
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
         BufferAdoptedQString
 #endif
         // NOTE: Adding more ownership types needs to extend m_hashAndFlags as we're at capacity
@@ -238,7 +238,7 @@ private:
         m_hashAndFlags = hash | BufferInternal;
     }
 
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
     // Used to create new strings that adopt an existing QString's data
     enum ConstructAdoptedQStringTag { ConstructAdoptedQString };
     StringImpl(QStringData* qStringData, ConstructAdoptedQStringTag)
@@ -364,7 +364,7 @@ public:
     WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<UChar>&);
     WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
 
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
     static PassRefPtr<StringImpl> adopt(QStringData*);
 #endif
 
@@ -429,7 +429,7 @@ public:
             m_hashAndFlags &= ~s_hashFlagIsAtomic;
     }
 
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
     QStringData* qStringData() { return bufferOwnership() == BufferAdoptedQString ? m_qStringData : 0; }
 #endif
 
@@ -657,7 +657,7 @@ private:
         void* m_buffer;
         StringImpl* m_substringBuffer;
         mutable UChar* m_copyData16;
-#if PLATFORM(QT) && HAVE(QT5)
+#if PLATFORM(QT)
         QStringData* m_qStringData;
 #endif
     };
index 1437d56f0ea65c070acb1d0d0332ee7b115cc7f3..23e2ae4fd1da4e4b79ef877a5ebf127aecdf5fa4 100644 (file)
@@ -1,3 +1,78 @@
+2012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * Target.pri:
+        * WebCore.pri:
+        * bridge/qt/qt_class.cpp:
+        (JSC::Bindings::QtClass::fallbackObject):
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtInstance::getPropertyNames):
+        (JSC::Bindings::QtInstance::stringValue):
+        (JSC::Bindings::QtField::setValueToInstance):
+        * bridge/qt/qt_runtime.h:
+        (QtConnectionObject):
+        * bridge/qt/qt_runtime_qt4.cpp: Removed.
+        * editing/qt/SmartReplaceQt.cpp: Removed.
+        * page/qt/EventHandlerQt.cpp:
+        (WebCore::EventHandler::tabsToAllFormControls):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/OpenGLShims.cpp:
+        (WebCore::getProcAddress):
+        * platform/graphics/OpenGLShims.h:
+        * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
+        * platform/graphics/gstreamer/PlatformVideoWindowQt.cpp:
+        (FullScreenVideoWindow::FullScreenVideoWindow):
+        (FullScreenVideoWindow::keyPressEvent):
+        (FullScreenVideoWindow::event):
+        (FullScreenVideoWindow::showFullScreen):
+        (PlatformVideoWindow::PlatformVideoWindow):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):
+        (WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded):
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::releaseWindowsContext):
+        * platform/graphics/qt/ImageQt.cpp:
+        (WebCore::BitmapImage::create):
+        * platform/graphics/qt/SimpleFontDataQt.cpp:
+        (WebCore::SimpleFontData::platformInit):
+        * platform/graphics/texmap/TextureMapper.h:
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext):
+        * platform/qt/DeviceMotionProviderQt.h:
+        * platform/qt/DeviceOrientationProviderQt.h:
+        * platform/qt/KURLQt.cpp:
+        (WebCore::KURL::operator QUrl):
+        * platform/qt/PlatformScreenQt.cpp:
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/qt/QWebPageClient.h:
+        (QWebPageClient):
+        * platform/qt/RenderThemeQt.cpp:
+        * platform/text/qt/TextBreakIteratorQt.cpp: Removed.
+        * plugins/qt/PluginContainerQt.cpp: Removed.
+        * plugins/qt/PluginContainerQt.h: Removed.
+        * plugins/qt/PluginPackageQt.cpp:
+        (WebCore::PluginPackage::isPluginBlacklisted):
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::setFocus):
+        (WebCore::PluginView::paintUsingXPixmap):
+        (WebCore::setSharedXEventFields):
+        (WebCore::PluginView::setNPWindowIfNeeded):
+        (WebCore::PluginView::setParentVisible):
+        (WebCore::PluginView::platformGetValue):
+        (WebCore::PluginView::invalidateRect):
+        (WebCore::getVisualAndColormap):
+        (WebCore::PluginView::platformStart):
+        * plugins/win/PluginViewWin.cpp:
+        (windowHandleForPageClient):
+
 2012-08-06  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: implement reusable progress bar
index 0f7cd0ccf3f9a1e2539fc3421c6cee35c1ba85d9..095c78813ecc101b956fe00af6d4801a01aa5a0c 100644 (file)
@@ -16,10 +16,6 @@ CONFIG += staticlib
 
 DEFINES += QT_MAKEDLL
 
-!haveQt(5) {
-    INCLUDEPATH += $$PWD/../WTF/wtf/qt/compat
-}
-
 RESOURCES += \
     $$PWD/WebCore.qrc
 
@@ -231,17 +227,13 @@ SOURCES += \
      bridge/qt/qt_class.cpp \
      bridge/qt/qt_instance.cpp \
      bridge/qt/qt_pixmapruntime.cpp \
+     bridge/qt/qt_runtime.cpp \
      bridge/runtime_array.cpp \
      bridge/runtime_method.cpp \
      bridge/runtime_object.cpp \
      bridge/runtime_root.cpp \
      testing/js/WebCoreTestSupport.cpp
 
-haveQt(5) {
-    SOURCES += bridge/qt/qt_runtime.cpp
-} else {
-    SOURCES += bridge/qt/qt_runtime_qt4.cpp
-}
 
 SOURCES += \
     Modules/filesystem/DOMFilePath.cpp \
@@ -2818,18 +2810,13 @@ mac {
         platform/text/cf/StringImplCF.cpp
 }
 
-haveQt(5) {
-    contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
-    mac {
-        # For Mac we use the same SmartReplace implementation as the Apple port.
-        SOURCES += editing/SmartReplaceCF.cpp
-        INCLUDEPATH += $$PWD/icu
-    } else {
-        SOURCES += editing/SmartReplaceICU.cpp
-    }
+contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
+mac {
+    # For Mac we use the same SmartReplace implementation as the Apple port.
+    SOURCES += editing/SmartReplaceCF.cpp
+    INCLUDEPATH += $$PWD/icu
 } else {
-    SOURCES += platform/text/qt/TextBreakIteratorQt.cpp \
-               editing/qt/SmartReplaceQt.cpp
+    SOURCES += editing/SmartReplaceICU.cpp
 }
 
 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
@@ -2848,11 +2835,6 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
             SOURCES += \
                 plugins/qt/PluginPackageQt.cpp \
                 plugins/qt/PluginViewQt.cpp
-
-            haveQt(4) {
-                SOURCES += plugins/qt/PluginContainerQt.cpp
-                HEADERS += plugins/qt/PluginContainerQt.h
-            }
         }
     }
 
index 2a59dc0317903eb75c53a8f11f4e255915387a9d..55520394a4d840c798e997861ff01b5e69317a9d 100644 (file)
@@ -7,8 +7,7 @@
 
 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
 
-QT *= network sql
-haveQt(5): QT *= core-private gui-private
+QT *= network sql core-private gui-private
 
 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
 
@@ -150,18 +149,8 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
     }
 }
 
-contains(DEFINES, ENABLE_GEOLOCATION=1) {
-    CONFIG *= mobility
-    MOBILITY *= location
-}
-
 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1)|contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
-    haveQt(5) {
-        QT += sensors
-    } else {
-        CONFIG *= mobility
-        MOBILITY *= sensors
-    }
+    QT += sensors
 }
 
 contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=1) {
@@ -193,7 +182,6 @@ contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
     contains(QT_CONFIG, opengles2): LIBS += -lEGL
     mac: LIBS += -framework IOSurface -framework CoreFoundation
     linux-*:contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
-    haveQt(4): QT *= opengl
 }
 
 !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
@@ -204,29 +192,22 @@ contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
     LIBS += -lsqlite3
 }
 
-haveQt(5) {
-    # Qt5 allows us to use config tests to check for the presence of these libraries
-    config_libjpeg {
-        DEFINES += WTF_USE_LIBJPEG=1
-        LIBS += -ljpeg
-    } else {
-        warning("JPEG library not found! QImageDecoder will decode JPEG images.")
-    }
-    config_libpng {
-        DEFINES += WTF_USE_LIBPNG=1
-        LIBS += -lpng
-    } else {
-        warning("PNG library not found! QImageDecoder will decode PNG images.")
-    }
-    config_libwebp {
-        DEFINES += WTF_USE_WEBP=1
-        LIBS += -lwebp
-    }
+# Qt5 allows us to use config tests to check for the presence of these libraries
+config_libjpeg {
+    DEFINES += WTF_USE_LIBJPEG=1
+    LIBS += -ljpeg
 } else {
-    !win32-*:!mac {
-        DEFINES += WTF_USE_LIBJPEG=1 WTF_USE_LIBPNG=1
-        LIBS += -ljpeg -lpng
-    }
+    warning("JPEG library not found! QImageDecoder will decode JPEG images.")
+}
+config_libpng {
+    DEFINES += WTF_USE_LIBPNG=1
+    LIBS += -lpng
+} else {
+    warning("PNG library not found! QImageDecoder will decode PNG images.")
+}
+config_libwebp {
+    DEFINES += WTF_USE_WEBP=1
+    LIBS += -lwebp
 }
 
 win32-*|wince* {
@@ -276,8 +257,7 @@ unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
 
 unix|win32-g++* {
-    QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
-    haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
+    QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork QtWidgets
 }
 
 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
index 00cd1c49af092221b629fdac8dbe135fad497545..ee22a6861bc51aeb758c7e8a69a8f2b9b34ca1c9 100644 (file)
@@ -99,16 +99,7 @@ JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, PropertyName id
         if (m.access() == QMetaMethod::Private)
             continue;
 
-#if !HAVE(QT5)
-        int iter = 0;
-        const char* signature = m.signature();
-        while (signature[iter] && signature[iter] != '(')
-            ++iter;
-
-        if (normal == QByteArray::fromRawData(signature, iter)) {
-#else
         if (normal == m.name()) {
-#endif
             QtRuntimeMetaMethod* val = QtRuntimeMetaMethod::create(exec, ustring, static_cast<QtInstance*>(inst), index, normal, false);
             qtinst->m_methods.insert(name, val);
             return val;
index 6b5e6a75a494e6799d93156e22b61dbe320a7ca5..4a0875506d7efaccbb246910e5767c10c0156e8e 100644 (file)
@@ -223,12 +223,8 @@ void QtInstance::getPropertyNames(ExecState* exec, PropertyNameArray& array)
         for (i = 0; i < methodCount; i++) {
             QMetaMethod method = meta->method(i);
             if (method.access() != QMetaMethod::Private) {
-#if HAVE(QT5)
                 QByteArray sig = method.methodSignature();
                 array.add(Identifier(exec, UString(sig.constData(), sig.length())));
-#else
-                array.add(Identifier(exec, method.signature()));
-#endif
             }
         }
     }
@@ -275,7 +271,6 @@ JSValue QtInstance::stringValue(ExecState* exec) const
             // Check to see how much we can call it
             if (m.access() != QMetaMethod::Private
                 && m.methodType() != QMetaMethod::Signal
-#if HAVE(QT5)
                 && m.parameterCount() == 0
                 && m.returnType() != QMetaType::Void) {
                 QVariant ret(m.returnType(), (void*)0);
@@ -286,20 +281,6 @@ JSValue QtInstance::stringValue(ExecState* exec) const
                     if (ret.isValid() && ret.canConvert(QVariant::String)) {
                         buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?
                         useDefault = false;
-#else
-                && m.parameterTypes().isEmpty()) {
-                const char* retsig = m.typeName();
-                if (retsig && *retsig) {
-                    QVariant ret(QMetaType::type(retsig), (void*)0);
-                    void * qargs[1];
-                    qargs[0] = ret.data();
-
-                    if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, qargs) < 0) {
-                        if (ret.isValid() && ret.canConvert(QVariant::String)) {
-                            buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?
-                            useDefault = false;
-                        }
-#endif
                     }
                 }
             }
@@ -389,11 +370,7 @@ void QtField::setValueToInstance(ExecState* exec, const Instance* inst, JSValue
     if (obj) {
         QMetaType::Type argtype = QMetaType::Void;
         if (m_type == MetaProperty)
-#if HAVE(QT5)
             argtype = (QMetaType::Type) m_property.userType();
-#else
-            argtype = (QMetaType::Type) QMetaType::type(m_property.typeName());
-#endif
 
         // dynamic properties just get any QVariant
         QVariant val = convertValueToQVariant(exec, aValue, argtype, 0);
index ac2cf2e0179b4de92ebe68cf9411b987c1ac9e43..3c694de82ce06487e956a8c5a6d89baf6d2458e4 100644 (file)
@@ -238,21 +238,11 @@ private:
 // with the appropriate signal of 'sender'. When execute() is called, it will call JS 'receiverFunction'.
 class QtConnectionObject : public QObject
 {
-#if HAVE(QT5)
     Q_OBJECT_FAKE
-#endif
 public:
     QtConnectionObject(JSContextRef, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction);
     ~QtConnectionObject();
 
-#if !HAVE(QT5)
-    // Explicitly define these because want a custom qt_metacall(), so we can't use Q_OBJECT macro.
-    static const QMetaObject staticMetaObject;
-    virtual const QMetaObject *metaObject() const;
-    virtual void *qt_metacast(const char *);
-    virtual int qt_metacall(QMetaObject::Call, int, void **argv);
-#endif
-
     void execute(void **argv);
 
     bool match(JSContextRef, QObject* sender, int signalIndex, JSObjectRef thisObject, JSObjectRef funcObject);
diff --git a/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp b/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp
deleted file mode 100644 (file)
index bf5e237..0000000
+++ /dev/null
@@ -1,1931 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#include "config.h"
-#include "qt_runtime.h"
-
-#include "APICast.h"
-#include "BooleanObject.h"
-#include "DateInstance.h"
-#include "DatePrototype.h"
-#include "FunctionPrototype.h"
-#include "Interpreter.h"
-#include "JSArray.h"
-#include "JSContextRefPrivate.h"
-#include "JSDocument.h"
-#include "JSDOMBinding.h"
-#include "JSDOMWindow.h"
-#include <JSFunction.h>
-#include "JSGlobalObject.h"
-#include "JSHTMLElement.h"
-#include "JSLock.h"
-#include "JSObject.h"
-#include "JSRetainPtr.h"
-#include "JSUint8ClampedArray.h"
-#include "ObjectPrototype.h"
-#include "PropertyNameArray.h"
-#include "RegExpConstructor.h"
-#include "RegExpObject.h"
-#include "qdatetime.h"
-#include "qdebug.h"
-#include "qmetaobject.h"
-#include "qmetatype.h"
-#include "qobject.h"
-#include "qstringlist.h"
-#include "qt_instance.h"
-#include "qt_pixmapruntime.h"
-#include "qvarlengtharray.h"
-
-#include <wtf/DateMath.h>
-
-#include <limits.h>
-#include <runtime/Error.h>
-#include <runtime_array.h>
-#include <runtime_object.h>
-
-// QtScript has these
-Q_DECLARE_METATYPE(QObjectList);
-Q_DECLARE_METATYPE(QList<int>);
-Q_DECLARE_METATYPE(QVariant);
-
-using namespace WebCore;
-
-namespace JSC {
-namespace Bindings {
-
-// Debugging
-//#define QTWK_RUNTIME_CONVERSION_DEBUG
-//#define QTWK_RUNTIME_MATCH_DEBUG
-
-class QWKNoDebug
-{
-public:
-    inline QWKNoDebug(){}
-    inline ~QWKNoDebug(){}
-
-    template<typename T>
-    inline QWKNoDebug &operator<<(const T &) { return *this; }
-};
-
-#ifdef QTWK_RUNTIME_CONVERSION_DEBUG
-#define qConvDebug() qDebug()
-#else
-#define qConvDebug() QWKNoDebug()
-#endif
-
-#ifdef QTWK_RUNTIME_MATCH_DEBUG
-#define qMatchDebug() qDebug()
-#else
-#define qMatchDebug() QWKNoDebug()
-#endif
-
-typedef enum {
-    Variant = 0,
-    Number,
-    Boolean,
-    String,
-    Date,
-    RegExp,
-    Array,
-    QObj,
-    Object,
-    Null,
-    RTArray,
-    JSUint8ClampedArrayType
-} JSRealType;
-
-#if defined(QTWK_RUNTIME_CONVERSION_DEBUG) || defined(QTWK_RUNTIME_MATCH_DEBUG)
-QDebug operator<<(QDebug dbg, const JSRealType &c)
-{
-     const char *map[] = { "Variant", "Number", "Boolean", "String", "Date",
-         "RegExp", "Array", "RTObject", "Object", "Null", "RTArray"};
-
-     dbg.nospace() << "JSType(" << ((int)c) << ", " <<  map[c] << ")";
-
-     return dbg.space();
-}
-#endif
-
-struct RuntimeConversion {
-    ConvertToJSValueFunction toJSValueFunc;
-    ConvertToVariantFunction toVariantFunc;
-};
-
-typedef QHash<int, RuntimeConversion> RuntimeConversionTable;
-Q_GLOBAL_STATIC(RuntimeConversionTable, customRuntimeConversions)
-
-void registerCustomType(int qtMetaTypeId, ConvertToVariantFunction toVariantFunc, ConvertToJSValueFunction toJSValueFunc)
-{
-    RuntimeConversion conversion;
-    conversion.toJSValueFunc = toJSValueFunc;
-    conversion.toVariantFunc = toVariantFunc;
-    customRuntimeConversions()->insert(qtMetaTypeId, conversion);
-}
-
-static bool isJSUint8ClampedArray(JSValue val)
-{
-    return val.isCell() && val.inherits(&JSUint8ClampedArray::s_info);
-}
-
-static JSRealType valueRealType(ExecState* exec, JSValue val)
-{
-    if (val.isNumber())
-        return Number;
-    else if (val.isString())
-        return String;
-    else if (val.isBoolean())
-        return Boolean;
-    else if (val.isNull())
-        return Null;
-    else if (isJSUint8ClampedArray(val))
-        return JSUint8ClampedArrayType;
-    else if (val.isObject()) {
-        JSObject *object = val.toObject(exec);
-        if (object->inherits(&RuntimeArray::s_info))  // RuntimeArray 'inherits' from Array, but not in C++
-            return RTArray;
-        else if (object->inherits(&JSArray::s_info))
-            return Array;
-        else if (object->inherits(&DateInstance::s_info))
-            return Date;
-        else if (object->inherits(&RegExpObject::s_info))
-            return RegExp;
-        else if (object->inherits(&RuntimeObject::s_info))
-            return QObj;
-        return Object;
-    }
-
-    return String; // I don't know.
-}
-
-QVariant convertValueToQVariant(ExecState*, JSValue, QMetaType::Type, int*, HashSet<JSObject*>*, int);
-
-static QVariantMap convertValueToQVariantMap(ExecState* exec, JSObject* object, HashSet<JSObject*>* visitedObjects, int recursionLimit)
-{
-    Q_ASSERT(!exec->hadException());
-
-    PropertyNameArray properties(exec);
-    object->methodTable()->getPropertyNames(object, exec, properties, ExcludeDontEnumProperties);
-    PropertyNameArray::const_iterator it = properties.begin();
-    QVariantMap result;
-    int objdist = 0;
-
-    while (it != properties.end()) {
-        if (object->propertyIsEnumerable(exec, *it)) {
-            JSValue val = object->get(exec, *it);
-            if (exec->hadException())
-                exec->clearException();
-            else {
-                QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
-                if (objdist >= 0) {
-                    UString ustring = (*it).ustring();
-                    QString id = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-                    result.insert(id, v);
-                }
-            }
-        }
-        ++it;
-    }
-    return result;
-}
-
-QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects, int recursionLimit)
-{
-    --recursionLimit;
-
-    if (!value || !recursionLimit)
-        return QVariant();
-
-    JSObject* object = 0;
-    if (value.isObject()) {
-        object = value.toObject(exec);
-        if (visitedObjects->contains(object))
-            return QVariant();
-
-        visitedObjects->add(object);
-    }
-
-    // check magic pointer values before dereferencing value
-    if (value == jsNaN()
-        || (value == jsUndefined()
-            && hint != QMetaType::QString
-            && hint != (QMetaType::Type) qMetaTypeId<QVariant>())) {
-        if (distance)
-            *distance = -1;
-        return QVariant();
-    }
-
-    JSLockHolder lock(exec);
-    JSRealType type = valueRealType(exec, value);
-    if (hint == QMetaType::Void) {
-        switch(type) {
-            case Number:
-                hint = QMetaType::Double;
-                break;
-            case Boolean:
-                hint = QMetaType::Bool;
-                break;
-            case String:
-            default:
-                hint = QMetaType::QString;
-                break;
-            case Date:
-                hint = QMetaType::QDateTime;
-                break;
-            case RegExp:
-                hint = QMetaType::QRegExp;
-                break;
-            case Object:
-                if (object->inherits(&NumberObject::s_info))
-                    hint = QMetaType::Double;
-                else if (object->inherits(&BooleanObject::s_info))
-                    hint = QMetaType::Bool;
-                else
-                    hint = QMetaType::QVariantMap;
-                break;
-            case QObj:
-                hint = QMetaType::QObjectStar;
-                break;
-            case JSUint8ClampedArrayType:
-                hint = QMetaType::QByteArray;
-                break;
-            case Array:
-            case RTArray:
-                hint = QMetaType::QVariantList;
-                break;
-        }
-    }
-
-    qConvDebug() << "convertValueToQVariant: jstype is " << type << ", hint is" << hint;
-
-    if (value == jsNull()
-        && hint != QMetaType::QObjectStar
-        && hint != QMetaType::VoidStar
-        && hint != QMetaType::QString
-        && hint != (QMetaType::Type) qMetaTypeId<QVariant>()) {
-        if (distance)
-            *distance = -1;
-        return QVariant();
-    }
-
-    QVariant ret;
-    int dist = -1;
-    switch (hint) {
-        case QMetaType::Bool:
-            if (type == Object && object->inherits(&BooleanObject::s_info))
-                ret = QVariant(asBooleanObject(value)->internalValue().toBoolean());
-            else
-                ret = QVariant(value.toBoolean());
-            if (type == Boolean)
-                dist = 0;
-            else
-                dist = 10;
-            break;
-
-        case QMetaType::Int:
-        case QMetaType::UInt:
-        case QMetaType::Long:
-        case QMetaType::ULong:
-        case QMetaType::LongLong:
-        case QMetaType::ULongLong:
-        case QMetaType::Short:
-        case QMetaType::UShort:
-        case QMetaType::Float:
-        case QMetaType::Double:
-            ret = QVariant(value.toNumber(exec));
-            ret.convert((QVariant::Type)hint);
-            if (type == Number) {
-                switch (hint) {
-                case QMetaType::Double:
-                    dist = 0;
-                    break;
-                case QMetaType::Float:
-                    dist = 1;
-                    break;
-                case QMetaType::LongLong:
-                case QMetaType::ULongLong:
-                    dist = 2;
-                    break;
-                case QMetaType::Long:
-                case QMetaType::ULong:
-                    dist = 3;
-                    break;
-                case QMetaType::Int:
-                case QMetaType::UInt:
-                    dist = 4;
-                    break;
-                case QMetaType::Short:
-                case QMetaType::UShort:
-                    dist = 5;
-                    break;
-                    break;
-                default:
-                    dist = 10;
-                    break;
-                }
-            } else {
-                dist = 10;
-            }
-            break;
-
-        case QMetaType::QChar:
-            if (type == Number || type == Boolean) {
-                ret = QVariant(QChar((ushort)value.toNumber(exec)));
-                if (type == Boolean)
-                    dist = 3;
-                else
-                    dist = 6;
-            } else {
-                UString str = value.toString(exec)->value(exec);
-                ret = QVariant(QChar(str.length() ? *(const ushort*)str.impl()->characters() : 0));
-                if (type == String)
-                    dist = 3;
-                else
-                    dist = 10;
-            }
-            break;
-
-        case QMetaType::QString: {
-            if (value.isUndefinedOrNull()) {
-                if (distance)
-                    *distance = 1;
-                return QString();
-            } else {
-                UString ustring = value.toString(exec)->value(exec);
-                ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()));
-                if (type == String)
-                    dist = 0;
-                else
-                    dist = 10;
-            }
-            break;
-        }
-
-        case QMetaType::QVariantMap:
-            if (type == Object || type == Array || type == RTArray) {
-                ret = QVariant(convertValueToQVariantMap(exec, object, visitedObjects, recursionLimit));
-                // Those types can still have perfect matches, e.g. 'bool' if value is a Boolean Object.
-                dist = 1;
-            }
-            break;
-
-        case QMetaType::QVariantList:
-            if (type == RTArray) {
-                RuntimeArray* rtarray = static_cast<RuntimeArray*>(object);
-
-                QVariantList result;
-                int len = rtarray->getLength();
-                int objdist = 0;
-                qConvDebug() << "converting a " << len << " length Array";
-                for (int i = 0; i < len; ++i) {
-                    JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
-                    result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit));
-                    if (objdist == -1) {
-                        qConvDebug() << "Failed converting element at index " << i;
-                        break; // Failed converting a list entry, so fail the array
-                    }
-                }
-                if (objdist != -1) {
-                    dist = 5;
-                    ret = QVariant(result);
-                }
-            } else if (type == Array) {
-                JSArray* array = static_cast<JSArray*>(object);
-
-                QVariantList result;
-                int len = array->length();
-                int objdist = 0;
-                qConvDebug() << "converting a " << len << " length Array";
-                for (int i = 0; i < len; ++i) {
-                    JSValue val = array->get(exec, i);
-                    result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit));
-                    if (objdist == -1) {
-                        qConvDebug() << "Failed converting element at index " << i;
-                        break; // Failed converting a list entry, so fail the array
-                    }
-                }
-                if (objdist != -1) {
-                    dist = 5;
-                    ret = QVariant(result);
-                }
-            } else {
-                // Make a single length array
-                int objdist;
-                qConvDebug() << "making a single length variantlist";
-                QVariant var = convertValueToQVariant(exec, value, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
-                if (objdist != -1) {
-                    QVariantList result;
-                    result << var;
-                    ret = QVariant(result);
-                    dist = 10;
-                } else {
-                    qConvDebug() << "failed making single length varlist";
-                }
-            }
-            break;
-
-        case QMetaType::QStringList: {
-            if (type == RTArray) {
-                RuntimeArray* rtarray = static_cast<RuntimeArray*>(object);
-
-                QStringList result;
-                int len = rtarray->getLength();
-                for (int i = 0; i < len; ++i) {
-                    JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
-                    UString ustring = val.toString(exec)->value(exec);
-                    QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-
-                    result.append(qstring);
-                }
-                dist = 5;
-                ret = QVariant(result);
-            } else if (type == Array) {
-                JSArray* array = static_cast<JSArray*>(object);
-
-                QStringList result;
-                int len = array->length();
-                for (int i = 0; i < len; ++i) {
-                    JSValue val = array->get(exec, i);
-                    UString ustring = val.toString(exec)->value(exec);
-                    QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-
-                    result.append(qstring);
-                }
-                dist = 5;
-                ret = QVariant(result);
-            } else {
-                // Make a single length array
-                UString ustring = value.toString(exec)->value(exec);
-                QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-                QStringList result;
-                result.append(qstring);
-                ret = QVariant(result);
-                dist = 10;
-            }
-            break;
-        }
-
-        case QMetaType::QByteArray: {
-            if (type == JSUint8ClampedArrayType) {
-                WTF::Uint8ClampedArray* arr = toUint8ClampedArray(value);
-                ret = QVariant(QByteArray(reinterpret_cast<const char*>(arr->data()), arr->length()));
-                dist = 0;
-            } else {
-                UString ustring = value.toString(exec)->value(exec);
-                ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()).toLatin1());
-                if (type == String)
-                    dist = 5;
-                else
-                    dist = 10;
-            }
-            break;
-        }
-
-        case QMetaType::QDateTime:
-        case QMetaType::QDate:
-        case QMetaType::QTime:
-            if (type == Date) {
-                DateInstance* date = static_cast<DateInstance*>(object);
-                GregorianDateTime gdt;
-                msToGregorianDateTime(exec, date->internalNumber(), true, gdt);
-                if (hint == QMetaType::QDateTime) {
-                    ret = QDateTime(QDate(gdt.year(), gdt.month() + 1, gdt.monthDay()), QTime(gdt.hour(), gdt.minute(), gdt.second()), Qt::UTC);
-                    dist = 0;
-                } else if (hint == QMetaType::QDate) {
-                    ret = QDate(gdt.year(), gdt.month() + 1, gdt.monthDay());
-                    dist = 1;
-                } else {
-                    ret = QTime(gdt.hour(), gdt.minute(), gdt.second());
-                    dist = 2;
-                }
-            } else if (type == Number) {
-                double b = value.toNumber(exec);
-                GregorianDateTime gdt;
-                msToGregorianDateTime(exec, b, true, gdt);
-                if (hint == QMetaType::QDateTime) {
-                    ret = QDateTime(QDate(gdt.year(), gdt.month() + 1, gdt.monthDay()), QTime(gdt.hour(), gdt.minute(), gdt.second()), Qt::UTC);
-                    dist = 6;
-                } else if (hint == QMetaType::QDate) {
-                    ret = QDate(gdt.year(), gdt.month() + 1, gdt.monthDay());
-                    dist = 8;
-                } else {
-                    ret = QTime(gdt.hour(), gdt.minute(), gdt.second());
-                    dist = 10;
-                }
-#ifndef QT_NO_DATESTRING
-            } else if (type == String) {
-                UString ustring = value.toString(exec)->value(exec);
-                QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-
-                if (hint == QMetaType::QDateTime) {
-                    QDateTime dt = QDateTime::fromString(qstring, Qt::ISODate);
-                    if (!dt.isValid())
-                        dt = QDateTime::fromString(qstring, Qt::TextDate);
-                    if (!dt.isValid())
-                        dt = QDateTime::fromString(qstring, Qt::SystemLocaleDate);
-                    if (!dt.isValid())
-                        dt = QDateTime::fromString(qstring, Qt::LocaleDate);
-                    if (dt.isValid()) {
-                        ret = dt;
-                        dist = 2;
-                    }
-                } else if (hint == QMetaType::QDate) {
-                    QDate dt = QDate::fromString(qstring, Qt::ISODate);
-                    if (!dt.isValid())
-                        dt = QDate::fromString(qstring, Qt::TextDate);
-                    if (!dt.isValid())
-                        dt = QDate::fromString(qstring, Qt::SystemLocaleDate);
-                    if (!dt.isValid())
-                        dt = QDate::fromString(qstring, Qt::LocaleDate);
-                    if (dt.isValid()) {
-                        ret = dt;
-                        dist = 3;
-                    }
-                } else {
-                    QTime dt = QTime::fromString(qstring, Qt::ISODate);
-                    if (!dt.isValid())
-                        dt = QTime::fromString(qstring, Qt::TextDate);
-                    if (!dt.isValid())
-                        dt = QTime::fromString(qstring, Qt::SystemLocaleDate);
-                    if (!dt.isValid())
-                        dt = QTime::fromString(qstring, Qt::LocaleDate);
-                    if (dt.isValid()) {
-                        ret = dt;
-                        dist = 3;
-                    }
-                }
-#endif // QT_NO_DATESTRING
-            }
-            break;
-
-        case QMetaType::QRegExp:
-            if (type == RegExp) {
-/*
-                RegExpObject *re = static_cast<RegExpObject*>(object);
-*/
-                // Attempt to convert.. a bit risky
-                UString ustring = value.toString(exec)->value(exec);
-                QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-
-                // this is of the form '/xxxxxx/i'
-                int firstSlash = qstring.indexOf(QLatin1Char('/'));
-                int lastSlash = qstring.lastIndexOf(QLatin1Char('/'));
-                if (firstSlash >=0 && lastSlash > firstSlash) {
-                    QRegExp realRe;
-
-                    realRe.setPattern(qstring.mid(firstSlash + 1, lastSlash - firstSlash - 1));
-
-                    if (qstring.mid(lastSlash + 1).contains(QLatin1Char('i')))
-                        realRe.setCaseSensitivity(Qt::CaseInsensitive);
-
-                    ret = QVariant::fromValue(realRe);
-                    dist = 0;
-                } else {
-                    qConvDebug() << "couldn't parse a JS regexp";
-                }
-            } else if (type == String) {
-                UString ustring = value.toString(exec)->value(exec);
-                QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
-
-                QRegExp re(qstring);
-                if (re.isValid()) {
-                    ret = QVariant::fromValue(re);
-                    dist = 10;
-                }
-            }
-            break;
-
-        case QMetaType::QObjectStar:
-            if (type == QObj) {
-                QtInstance* qtinst = QtInstance::getInstance(object);
-                if (qtinst) {
-                    if (qtinst->getObject()) {
-                        qConvDebug() << "found instance, with object:" << (void*) qtinst->getObject();
-                        ret = QVariant::fromValue(qtinst->getObject());
-                        qConvDebug() << ret;
-                        dist = 0;
-                    } else {
-                        qConvDebug() << "can't convert deleted qobject";
-                    }
-                } else {
-                    qConvDebug() << "wasn't a qtinstance";
-                }
-            } else if (type == Null) {
-                QObject* nullobj = 0;
-                ret = QVariant::fromValue(nullobj);
-                dist = 0;
-            } else {
-                qConvDebug() << "previous type was not an object:" << type;
-            }
-            break;
-
-        case QMetaType::VoidStar:
-            if (type == QObj) {
-                QtInstance* qtinst = QtInstance::getInstance(object);
-                if (qtinst) {
-                    if (qtinst->getObject()) {
-                        qConvDebug() << "found instance, with object:" << (void*) qtinst->getObject();
-                        ret = QVariant::fromValue((void *)qtinst->getObject());
-                        qConvDebug() << ret;
-                        dist = 0;
-                    } else {
-                        qConvDebug() << "can't convert deleted qobject";
-                    }
-                } else {
-                    qConvDebug() << "wasn't a qtinstance";
-                }
-            } else if (type == Null) {
-                ret = QVariant::fromValue((void*)0);
-                dist = 0;
-            } else if (type == Number) {
-                // I don't think that converting a double to a pointer is a wise
-                // move.  Except maybe 0.
-                qConvDebug() << "got number for void * - not converting, seems unsafe:" << value.toNumber(exec);
-            } else {
-                qConvDebug() << "void* - unhandled type" << type;
-            }
-            break;
-
-        default:
-            // Non const type ids
-            if (hint == (QMetaType::Type) qMetaTypeId<QObjectList>())
-            {
-                if (type == RTArray) {
-                    RuntimeArray* rtarray = static_cast<RuntimeArray*>(object);
-
-                    QObjectList result;
-                    int len = rtarray->getLength();
-                    for (int i = 0; i < len; ++i) {
-                        JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
-                        int itemdist = -1;
-                        QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
-                        if (itemdist >= 0)
-                            result.append(item.value<QObject*>());
-                        else
-                            break;
-                    }
-                    // If we didn't fail conversion
-                    if (result.count() == len) {
-                        dist = 5;
-                        ret = QVariant::fromValue(result);
-                    }
-                } else if (type == Array) {
-                    JSObject* object = value.toObject(exec);
-                    JSArray* array = static_cast<JSArray *>(object);
-                    QObjectList result;
-                    int len = array->length();
-                    for (int i = 0; i < len; ++i) {
-                        JSValue val = array->get(exec, i);
-                        int itemdist = -1;
-                        QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
-                        if (itemdist >= 0)
-                            result.append(item.value<QObject*>());
-                        else
-                            break;
-                    }
-                    // If we didn't fail conversion
-                    if (result.count() == len) {
-                        dist = 5;
-                        ret = QVariant::fromValue(result);
-                    }
-                } else {
-                    // Make a single length array
-                    QObjectList result;
-                    int itemdist = -1;
-                    QVariant item = convertValueToQVariant(exec, value, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
-                    if (itemdist >= 0) {
-                        result.append(item.value<QObject*>());
-                        dist = 10;
-                        ret = QVariant::fromValue(result);
-                    }
-                }
-                break;
-            } else if (hint == (QMetaType::Type) qMetaTypeId<QList<int> >()) {
-                if (type == RTArray) {
-                    RuntimeArray* rtarray = static_cast<RuntimeArray*>(object);
-
-                    QList<int> result;
-                    int len = rtarray->getLength();
-                    for (int i = 0; i < len; ++i) {
-                        JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
-                        int itemdist = -1;
-                        QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
-                        if (itemdist >= 0)
-                            result.append(item.value<int>());
-                        else
-                            break;
-                    }
-                    // If we didn't fail conversion
-                    if (result.count() == len) {
-                        dist = 5;
-                        ret = QVariant::fromValue(result);
-                    }
-                } else if (type == Array) {
-                    JSArray* array = static_cast<JSArray *>(object);
-
-                    QList<int> result;
-                    int len = array->length();
-                    for (int i = 0; i < len; ++i) {
-                        JSValue val = array->get(exec, i);
-                        int itemdist = -1;
-                        QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
-                        if (itemdist >= 0)
-                            result.append(item.value<int>());
-                        else
-                            break;
-                    }
-                    // If we didn't fail conversion
-                    if (result.count() == len) {
-                        dist = 5;
-                        ret = QVariant::fromValue(result);
-                    }
-                } else {
-                    // Make a single length array
-                    QList<int> result;
-                    int itemdist = -1;
-                    QVariant item = convertValueToQVariant(exec, value, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
-                    if (itemdist >= 0) {
-                        result.append(item.value<int>());
-                        dist = 10;
-                        ret = QVariant::fromValue(result);
-                    }
-                }
-                break;
-            } else if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(hint))) {
-                ret = QtPixmapInstance::variantFromObject(object, static_cast<QMetaType::Type>(hint));
-            } else if (customRuntimeConversions()->contains(hint)) {
-                ret = customRuntimeConversions()->value(hint).toVariantFunc(object, &dist, visitedObjects);
-                if (dist == 0)
-                    break;
-            } else if (hint == (QMetaType::Type) qMetaTypeId<QVariant>()) {
-                if (value.isUndefinedOrNull()) {
-                    if (distance)
-                        *distance = 1;
-                    return QVariant();
-                } else {
-                    if (type == Object) {
-                        // Since we haven't really visited this object yet, we remove it
-                        visitedObjects->remove(object);
-                    }
-
-                    // And then recurse with the autodetect flag
-                    ret = convertValueToQVariant(exec, value, QMetaType::Void, distance, visitedObjects, recursionLimit);
-                    dist = 10;
-                }
-                break;
-            }
-
-            dist = 10;
-            break;
-    }
-
-    if (!ret.isValid())
-        dist = -1;
-    if (distance)
-        *distance = dist;
-
-    return ret;
-}
-
-QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance)
-{
-    const int recursionLimit = 200;
-    HashSet<JSObject*> visitedObjects;
-    return convertValueToQVariant(exec, value, hint, distance, &visitedObjects, recursionLimit);
-}
-
-JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant)
-{
-    // Variants with QObject * can be isNull but not a null pointer
-    // An empty QString variant is also null
-    QMetaType::Type type = (QMetaType::Type) variant.userType();
-
-    qConvDebug() << "convertQVariantToValue: metatype:" << type << ", isnull: " << variant.isNull();
-    if (variant.isNull() &&
-        type != QMetaType::QObjectStar &&
-        type != QMetaType::VoidStar &&
-        type != QMetaType::QWidgetStar &&
-        type != QMetaType::QString) {
-        return jsNull();
-    }
-
-    JSLockHolder lock(exec);
-
-    if (type == QMetaType::Bool)
-        return jsBoolean(variant.toBool());
-
-    if (type == QMetaType::Int ||
-        type == QMetaType::UInt ||
-        type == QMetaType::Long ||
-        type == QMetaType::ULong ||
-        type == QMetaType::LongLong ||
-        type == QMetaType::ULongLong ||
-        type == QMetaType::Short ||
-        type == QMetaType::UShort ||
-        type == QMetaType::Float ||
-        type == QMetaType::Double)
-        return jsNumber(variant.toDouble());
-
-    if (type == QMetaType::QRegExp) {
-        QRegExp re = variant.value<QRegExp>();
-
-        if (re.isValid()) {
-            UString pattern((UChar*)re.pattern().utf16(), re.pattern().length());
-            RegExpFlags flags = (re.caseSensitivity() == Qt::CaseInsensitive) ? FlagIgnoreCase : NoFlags;
-
-            JSC::RegExp* regExp = JSC::RegExp::create(exec->globalData(), pattern, flags);
-            if (regExp->isValid())
-                return RegExpObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp);
-            return jsNull();
-        }
-    }
-
-    if (type == QMetaType::QDateTime ||
-        type == QMetaType::QDate ||
-        type == QMetaType::QTime) {
-
-        QDate date = QDate::currentDate();
-        QTime time(0,0,0); // midnight
-
-        if (type == QMetaType::QDate)
-            date = variant.value<QDate>();
-        else if (type == QMetaType::QTime)
-            time = variant.value<QTime>();
-        else {
-            QDateTime dt = variant.value<QDateTime>().toLocalTime();
-            date = dt.date();
-            time = dt.time();
-        }
-
-        // Dates specified this way are in local time (we convert DateTimes above)
-        GregorianDateTime dt;
-        dt.setYear(date.year());
-        dt.setMonth(date.month() - 1);
-        dt.setMonthDay(date.day());
-        dt.setHour(time.hour());
-        dt.setMinute(time.minute());
-        dt.setSecond(time.second());
-        dt.setIsDST(-1);
-        double ms = gregorianDateTimeToMS(exec, dt, time.msec(), /*inputIsUTC*/ false);
-
-        return DateInstance::create(exec, exec->lexicalGlobalObject()->dateStructure(), trunc(ms));
-    }
-
-    if (type == QMetaType::QByteArray) {
-        QByteArray qtByteArray = variant.value<QByteArray>();
-        WTF::RefPtr<WTF::Uint8ClampedArray> wtfByteArray = WTF::Uint8ClampedArray::createUninitialized(qtByteArray.length());
-        memcpy(wtfByteArray->data(), qtByteArray.constData(), qtByteArray.length());
-        return toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), wtfByteArray.get());
-    }
-
-    if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) {
-        QObject* obj = variant.value<QObject*>();
-        if (!obj)
-            return jsNull();
-        return QtInstance::getQtInstance(obj, root, QtInstance::QtOwnership)->createRuntimeObject(exec);
-    }
-
-    if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(variant.type())))
-        return QtPixmapInstance::createPixmapRuntimeObject(exec, root, variant);
-
-    if (customRuntimeConversions()->contains(type)) {
-        if (!root->globalObject()->inherits(&JSDOMWindow::s_info))
-            return jsUndefined();
-
-        Document* document = (static_cast<JSDOMWindow*>(root->globalObject()))->impl()->document();
-        if (!document)
-            return jsUndefined();
-        return customRuntimeConversions()->value(type).toJSValueFunc(exec, toJSDOMGlobalObject(document, exec), variant);
-    }
-
-    if (type == QMetaType::QVariantMap) {
-        // create a new object, and stuff properties into it
-        JSObject* ret = constructEmptyObject(exec);
-        QVariantMap map = variant.value<QVariantMap>();
-        QVariantMap::const_iterator i = map.constBegin();
-        while (i != map.constEnd()) {
-            QString s = i.key();
-            JSValue val = convertQVariantToValue(exec, root.get(), i.value());
-            if (val) {
-                PutPropertySlot slot;
-                ret->methodTable()->put(ret, exec, Identifier(&exec->globalData(), reinterpret_cast_ptr<const UChar *>(s.constData()), s.length()), val, slot);
-                // ### error case?
-            }
-            ++i;
-        }
-
-        return ret;
-    }
-
-    // List types
-    if (type == QMetaType::QVariantList) {
-        QVariantList vl = variant.toList();
-        qConvDebug() << "got a " << vl.count() << " length list:" << vl;
-        return RuntimeArray::create(exec, new QtArray<QVariant>(vl, QMetaType::Void, root));
-    } else if (type == QMetaType::QStringList) {
-        QStringList sl = variant.value<QStringList>();
-        return RuntimeArray::create(exec, new QtArray<QString>(sl, QMetaType::QString, root));
-    } else if (type == (QMetaType::Type) qMetaTypeId<QObjectList>()) {
-        QObjectList ol= variant.value<QObjectList>();
-        return RuntimeArray::create(exec, new QtArray<QObject*>(ol, QMetaType::QObjectStar, root));
-    } else if (type == (QMetaType::Type)qMetaTypeId<QList<int> >()) {
-        QList<int> il= variant.value<QList<int> >();
-        return RuntimeArray::create(exec, new QtArray<int>(il, QMetaType::Int, root));
-    }
-
-    if (type == (QMetaType::Type)qMetaTypeId<QVariant>()) {
-        QVariant real = variant.value<QVariant>();
-        qConvDebug() << "real variant is:" << real;
-        return convertQVariantToValue(exec, root, real);
-    }
-
-    qConvDebug() << "fallback path for" << variant << variant.userType();
-
-    QString string = variant.toString();
-    UString ustring((UChar*)string.utf16(), string.length());
-    return jsString(exec, ustring);
-}
-
-// ===============
-
-// Qt-like macros
-#define QW_D(Class) Class##Data* d = d_func()
-#define QW_DS(Class,Instance) Class##Data* d = Instance->d_func()
-
-const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMethod) };
-
-QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const UString& identifier)
-    : InternalFunction(exec->lexicalGlobalObject(), structure)
-    , d_ptr(dd)
-{
-}
-
-void QtRuntimeMethod::finishCreation(ExecState* exec, const UString& identifier, PassRefPtr<QtInstance> instance)
-{
-    Base::finishCreation(exec->globalData(), identifier);
-    QW_D(QtRuntimeMethod);
-    d->m_instance = instance;
-    d->m_finalizer = PassWeak<QtRuntimeMethod>(this, d);
-}
-
-QtRuntimeMethod::~QtRuntimeMethod()
-{
-    delete d_ptr;
-}
-
-void QtRuntimeMethod::destroy(JSCell* cell)
-{
-    static_cast<QtRuntimeMethod*>(cell)->QtRuntimeMethod::~QtRuntimeMethod();
-}
-
-// ===============
-
-QtRuntimeMethodData::~QtRuntimeMethodData()
-{
-}
-
-void QtRuntimeMethodData::finalize(Handle<Unknown>, void*)
-{
-    m_instance->removeUnusedMethods();
-}
-
-QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData()
-{
-
-}
-
-QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData()
-{
-
-}
-
-// ===============
-
-// Type conversion metadata (from QtScript originally)
-class QtMethodMatchType
-{
-public:
-    enum Kind {
-        Invalid,
-        Variant,
-        MetaType,
-        Unresolved,
-        MetaEnum
-    };
-
-
-    QtMethodMatchType()
-        : m_kind(Invalid) { }
-
-    Kind kind() const
-    { return m_kind; }
-
-    QMetaType::Type typeId() const;
-
-    bool isValid() const
-    { return (m_kind != Invalid); }
-
-    bool isVariant() const
-    { return (m_kind == Variant); }
-
-    bool isMetaType() const
-    { return (m_kind == MetaType); }
-
-    bool isUnresolved() const
-    { return (m_kind == Unresolved); }
-
-    bool isMetaEnum() const
-    { return (m_kind == MetaEnum); }
-
-    QByteArray name() const;
-
-    int enumeratorIndex() const
-    { Q_ASSERT(isMetaEnum()); return m_typeId; }
-
-    static QtMethodMatchType variant()
-    { return QtMethodMatchType(Variant); }
-
-    static QtMethodMatchType metaType(int typeId, const QByteArray &name)
-    { return QtMethodMatchType(MetaType, typeId, name); }
-
-    static QtMethodMatchType metaEnum(int enumIndex, const QByteArray &name)
-    { return QtMethodMatchType(MetaEnum, enumIndex, name); }
-
-    static QtMethodMatchType unresolved(const QByteArray &name)
-    { return QtMethodMatchType(Unresolved, /*typeId=*/0, name); }
-
-private:
-    QtMethodMatchType(Kind kind, int typeId = 0, const QByteArray &name = QByteArray())
-        : m_kind(kind), m_typeId(typeId), m_name(name) { }
-
-    Kind m_kind;
-    int m_typeId;
-    QByteArray m_name;
-};
-
-QMetaType::Type QtMethodMatchType::typeId() const
-{
-    if (isVariant())
-        return (QMetaType::Type) QMetaType::type("QVariant");
-    return (QMetaType::Type) (isMetaEnum() ? QMetaType::Int : m_typeId);
-}
-
-QByteArray QtMethodMatchType::name() const
-{
-    if (!m_name.isEmpty())
-        return m_name;
-    else if (m_kind == Variant)
-        return "QVariant";
-    return QByteArray();
-}
-
-struct QtMethodMatchData
-{
-    int matchDistance;
-    int index;
-    QVector<QtMethodMatchType> types;
-    QVarLengthArray<QVariant, 10> args;
-
-    QtMethodMatchData(int dist, int idx, QVector<QtMethodMatchType> typs,
-                                const QVarLengthArray<QVariant, 10> &as)
-        : matchDistance(dist), index(idx), types(typs), args(as) { }
-    QtMethodMatchData()
-        : index(-1) { }
-
-    bool isValid() const
-    { return (index != -1); }
-
-    int firstUnresolvedIndex() const
-    {
-        for (int i=0; i < types.count(); i++) {
-            if (types.at(i).isUnresolved())
-                return i;
-        }
-        return -1;
-    }
-};
-
-static int indexOfMetaEnum(const QMetaObject *meta, const QByteArray &str)
-{
-    QByteArray scope;
-    QByteArray name;
-    int scopeIdx = str.indexOf("::");
-    if (scopeIdx != -1) {
-        scope = str.left(scopeIdx);
-        name = str.mid(scopeIdx + 2);
-    } else {
-        name = str;
-    }
-    for (int i = meta->enumeratorCount() - 1; i >= 0; --i) {
-        QMetaEnum m = meta->enumerator(i);
-        if ((m.name() == name)/* && (scope.isEmpty() || (m.scope() == scope))*/)
-            return i;
-    }
-    return -1;
-}
-
-// Helper function for resolving methods
-// Largely based on code in QtScript for compatibility reasons
-static int findMethodIndex(ExecState* exec,
-                           const QMetaObject* meta,
-                           const QByteArray& signature,
-                           bool allowPrivate,
-                           QVarLengthArray<QVariant, 10> &vars,
-                           void** vvars,
-                           JSObject **pError)
-{
-    QList<int> matchingIndices;
-
-    bool overloads = !signature.contains('(');
-
-    int count = meta->methodCount();
-    for (int i = count - 1; i >= 0; --i) {
-        const QMetaMethod m = meta->method(i);
-
-        // Don't choose private methods
-        if (m.access() == QMetaMethod::Private && !allowPrivate)
-            continue;
-
-        // try and find all matching named methods
-        if (m.signature() == signature)
-            matchingIndices.append(i);
-        else if (overloads) {
-            QByteArray rawsignature = m.signature();
-            rawsignature.truncate(rawsignature.indexOf('('));
-            if (rawsignature == signature)
-                matchingIndices.append(i);
-        }
-    }
-
-    int chosenIndex = -1;
-    *pError = 0;
-    QVector<QtMethodMatchType> chosenTypes;
-
-    QVarLengthArray<QVariant, 10> args;
-    QVector<QtMethodMatchData> candidates;
-    QVector<QtMethodMatchData> unresolved;
-    QVector<int> tooFewArgs;
-    QVector<int> conversionFailed;
-
-    foreach(int index, matchingIndices) {
-        QMetaMethod method = meta->method(index);
-
-        QVector<QtMethodMatchType> types;
-        bool unresolvedTypes = false;
-
-        // resolve return type
-        QByteArray returnTypeName = method.typeName();
-        int rtype = QMetaType::type(returnTypeName);
-        if ((rtype == 0) && !returnTypeName.isEmpty()) {
-            if (returnTypeName == "QVariant") {
-                types.append(QtMethodMatchType::variant());
-            } else if (returnTypeName.endsWith('*')) {
-                types.append(QtMethodMatchType::metaType(QMetaType::VoidStar, returnTypeName));
-            } else {
-                int enumIndex = indexOfMetaEnum(meta, returnTypeName);
-                if (enumIndex != -1)
-                    types.append(QtMethodMatchType::metaEnum(enumIndex, returnTypeName));
-                else {
-                    unresolvedTypes = true;
-                    types.append(QtMethodMatchType::unresolved(returnTypeName));
-                }
-            }
-        } else {
-            if (returnTypeName == "QVariant")
-                types.append(QtMethodMatchType::variant());
-            else
-                types.append(QtMethodMatchType::metaType(rtype, returnTypeName));
-        }
-
-        // resolve argument types
-        QList<QByteArray> parameterTypeNames = method.parameterTypes();
-        for (int i = 0; i < parameterTypeNames.count(); ++i) {
-            QByteArray argTypeName = parameterTypeNames.at(i);
-            int atype = QMetaType::type(argTypeName);
-            if (atype == 0) {
-                if (argTypeName == "QVariant") {
-                    types.append(QtMethodMatchType::variant());
-                } else {
-                    int enumIndex = indexOfMetaEnum(meta, argTypeName);
-                    if (enumIndex != -1)
-                        types.append(QtMethodMatchType::metaEnum(enumIndex, argTypeName));
-                    else {
-                        unresolvedTypes = true;
-                        types.append(QtMethodMatchType::unresolved(argTypeName));
-                    }
-                }
-            } else {
-                if (argTypeName == "QVariant")
-                    types.append(QtMethodMatchType::variant());
-                else
-                    types.append(QtMethodMatchType::metaType(atype, argTypeName));
-            }
-        }
-
-        // If the native method requires more arguments than what was passed from JavaScript
-        if (exec->argumentCount() + 1 < static_cast<unsigned>(types.count())) {
-            qMatchDebug() << "Match:too few args for" << method.signature();
-            tooFewArgs.append(index);
-            continue;
-        }
-
-        if (unresolvedTypes) {
-            qMatchDebug() << "Match:unresolved arg types for" << method.signature();
-            // remember it so we can give an error message later, if necessary
-            unresolved.append(QtMethodMatchData(/*matchDistance=*/INT_MAX, index,
-                                                   types, QVarLengthArray<QVariant, 10>()));
-            continue;
-        }
-
-        // Now convert arguments
-        if (args.count() != types.count())
-            args.resize(types.count());
-
-        QtMethodMatchType retType = types[0];
-        args[0] = QVariant(retType.typeId(), (void *)0); // the return value
-
-        bool converted = true;
-        int matchDistance = 0;
-        for (unsigned i = 0; converted && i + 1 < static_cast<unsigned>(types.count()); ++i) {
-            JSValue arg = i < exec->argumentCount() ? exec->argument(i) : jsUndefined();
-
-            int argdistance = -1;
-            QVariant v = convertValueToQVariant(exec, arg, types.at(i+1).typeId(), &argdistance);
-            if (argdistance >= 0) {
-                matchDistance += argdistance;
-                args[i+1] = v;
-            } else {
-                qMatchDebug() << "failed to convert argument " << i << "type" << types.at(i+1).typeId() << QMetaType::typeName(types.at(i+1).typeId());
-                converted = false;
-            }
-        }
-
-        qMatchDebug() << "Match: " << method.signature() << (converted ? "converted":"failed to convert") << "distance " << matchDistance;
-
-        if (converted) {
-            if ((exec->argumentCount() + 1 == static_cast<unsigned>(types.count()))
-                && (matchDistance == 0)) {
-                // perfect match, use this one
-                chosenIndex = index;
-                break;
-            } else {
-                QtMethodMatchData currentMatch(matchDistance, index, types, args);
-                if (candidates.isEmpty()) {
-                    candidates.append(currentMatch);
-                } else {
-                    QtMethodMatchData bestMatchSoFar = candidates.at(0);
-                    if ((args.count() > bestMatchSoFar.args.count())
-                        || ((args.count() == bestMatchSoFar.args.count())
-                            && (matchDistance <= bestMatchSoFar.matchDistance))) {
-                        candidates.prepend(currentMatch);
-                    } else {
-                        candidates.append(currentMatch);
-                    }
-                }
-            }
-        } else {
-            conversionFailed.append(index);
-        }
-
-        if (!overloads)
-            break;
-    }
-
-    if (chosenIndex == -1 && candidates.count() == 0) {
-        // No valid functions at all - format an error message
-        if (!conversionFailed.isEmpty()) {
-            QString message = QString::fromLatin1("incompatible type of argument(s) in call to %0(); candidates were\n")
-                              .arg(QLatin1String(signature));
-            for (int i = 0; i < conversionFailed.size(); ++i) {
-                if (i > 0)
-                    message += QLatin1String("\n");
-                QMetaMethod mtd = meta->method(conversionFailed.at(i));
-                message += QString::fromLatin1("    %0").arg(QString::fromLatin1(mtd.signature()));
-            }
-            *pError = throwError(exec, createTypeError(exec, message.toLatin1().constData()));
-        } else if (!unresolved.isEmpty()) {
-            QtMethodMatchData argsInstance = unresolved.first();
-            int unresolvedIndex = argsInstance.firstUnresolvedIndex();
-            Q_ASSERT(unresolvedIndex != -1);
-            QtMethodMatchType unresolvedType = argsInstance.types.at(unresolvedIndex);
-            QString message = QString::fromLatin1("cannot call %0(): unknown type `%1'")
-                .arg(QString::fromLatin1(signature))
-                .arg(QLatin1String(unresolvedType.name()));
-            *pError = throwError(exec, createTypeError(exec, message.toLatin1().constData()));
-        } else {
-            QString message = QString::fromLatin1("too few arguments in call to %0(); candidates are\n")
-                              .arg(QLatin1String(signature));
-            for (int i = 0; i < tooFewArgs.size(); ++i) {
-                if (i > 0)
-                    message += QLatin1String("\n");
-                QMetaMethod mtd = meta->method(tooFewArgs.at(i));
-                message += QString::fromLatin1("    %0").arg(QString::fromLatin1(mtd.signature()));
-            }
-            *pError = throwError(exec, createSyntaxError(exec, message.toLatin1().constData()));
-        }
-    }
-
-    if (chosenIndex == -1 && candidates.count() > 0) {
-        QtMethodMatchData bestMatch = candidates.at(0);
-        if ((candidates.size() > 1)
-            && (bestMatch.args.count() == candidates.at(1).args.count())
-            && (bestMatch.matchDistance == candidates.at(1).matchDistance)) {
-            // ambiguous call
-            QString message = QString::fromLatin1("ambiguous call of overloaded function %0(); candidates were\n")
-                                .arg(QLatin1String(signature));
-            for (int i = 0; i < candidates.size(); ++i) {
-                // Only candidate for overload if argument count and match distance is same as best match
-                if (candidates.at(i).args.count() == bestMatch.args.count()
-                    || candidates.at(i).matchDistance == bestMatch.matchDistance) {
-                    if (i > 0)
-                        message += QLatin1String("\n");
-                    QMetaMethod mtd = meta->method(candidates.at(i).index);
-                    message += QString::fromLatin1("    %0").arg(QString::fromLatin1(mtd.signature()));
-                }
-            }
-            *pError = throwError(exec, createTypeError(exec, message.toLatin1().constData()));
-        } else {
-            chosenIndex = bestMatch.index;
-            args = bestMatch.args;
-        }
-    }
-
-    if (chosenIndex != -1) {
-        /* Copy the stuff over */
-        int i;
-        vars.resize(args.count());
-        for (i=0; i < args.count(); i++) {
-            vars[i] = args[i];
-            vvars[i] = vars[i].data();
-        }
-    }
-
-    return chosenIndex;
-}
-
-// Signals are not fuzzy matched as much as methods
-static int findSignalIndex(const QMetaObject* meta, int initialIndex, QByteArray signature)
-{
-    int index = initialIndex;
-    QMetaMethod method = meta->method(index);
-    bool overloads = !signature.contains('(');
-    if (overloads && (method.attributes() & QMetaMethod::Cloned)) {
-        // find the most general method
-        do {
-            method = meta->method(--index);
-        } while (method.attributes() & QMetaMethod::Cloned);
-    }
-    return index;
-}
-
-const ClassInfo QtRuntimeMetaMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMetaMethod) };
-
-QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const UString& identifier)
-    : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier)
-{
-}
-
-void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const UString& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
-{
-    Base::finishCreation(exec, identifier, instance);
-    QW_D(QtRuntimeMetaMethod);
-    d->m_signature = signature;
-    d->m_index = index;
-    d->m_allowPrivate = allowPrivate;
-}
-
-void QtRuntimeMetaMethod::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
-    QtRuntimeMethod::visitChildren(thisObject, visitor);
-    QtRuntimeMetaMethodData* d = thisObject->d_func();
-    if (d->m_connect)
-        visitor.append(&d->m_connect);
-    if (d->m_disconnect)
-        visitor.append(&d->m_disconnect);
-}
-
-EncodedJSValue QtRuntimeMetaMethod::call(ExecState* exec)
-{
-    QtRuntimeMetaMethodData* d = static_cast<QtRuntimeMetaMethod *>(exec->callee())->d_func();
-
-    // We're limited to 10 args
-    if (exec->argumentCount() > 10)
-        return JSValue::encode(jsUndefined());
-
-    // We have to pick a method that matches..
-    JSLockHolder lock(exec);
-
-    QObject *obj = d->m_instance->getObject();
-    if (obj) {
-        QVarLengthArray<QVariant, 10> vargs;
-        void *qargs[11];
-
-        int methodIndex;
-        JSObject* errorObj = 0;
-        if ((methodIndex = findMethodIndex(exec, obj->metaObject(), d->m_signature, d->m_allowPrivate, vargs, (void **)qargs, &errorObj)) != -1) {
-            if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, methodIndex, qargs) >= 0)
-                return JSValue::encode(jsUndefined());
-
-            if (vargs.size() > 0 && vargs[0].isValid())
-                return JSValue::encode(convertQVariantToValue(exec, d->m_instance->rootObject(), vargs[0]));
-        }
-
-        if (errorObj)
-            return JSValue::encode(errorObj);
-    } else {
-        return throwVMError(exec, createError(exec, "cannot call function of deleted QObject"));
-    }
-
-    // void functions return undefined
-    return JSValue::encode(jsUndefined());
-}
-
-CallType QtRuntimeMetaMethod::getCallData(JSCell*, CallData& callData)
-{
-    callData.native.function = call;
-    return CallTypeHost;
-}
-
-bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
-    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
-    if (propertyName == Identifier(exec, "connect")) {
-        slot.setCustom(thisObject, thisObject->connectGetter);
-        return true;
-    }
-    if (propertyName == Identifier(exec, "disconnect")) {
-        slot.setCustom(thisObject, thisObject->disconnectGetter);
-        return true;
-    }
-    if (propertyName == exec->propertyNames().length) {
-        slot.setCustom(thisObject, thisObject->lengthGetter);
-        return true;
-    }
-
-    return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
-}
-
-bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
-    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(object);
-    if (propertyName == Identifier(exec, "connect")) {
-        PropertySlot slot;
-        slot.setCustom(thisObject, connectGetter);
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
-        return true;
-    }
-
-    if (propertyName == Identifier(exec, "disconnect")) {
-        PropertySlot slot;
-        slot.setCustom(thisObject, disconnectGetter);
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
-        return true;
-    }
-
-    if (propertyName == exec->propertyNames().length) {
-        PropertySlot slot;
-        slot.setCustom(thisObject, lengthGetter);
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
-        return true;
-    }
-
-    return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
-
-void QtRuntimeMetaMethod::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
-    if (mode == IncludeDontEnumProperties) {
-        propertyNames.add(Identifier(exec, "connect"));
-        propertyNames.add(Identifier(exec, "disconnect"));
-        propertyNames.add(exec->propertyNames().length);
-    }
-
-    QtRuntimeMethod::getOwnPropertyNames(object, exec, propertyNames, mode);
-}
-
-JSValue QtRuntimeMetaMethod::lengthGetter(ExecState*, JSValue, PropertyName)
-{
-    // QtScript always returns 0
-    return jsNumber(0);
-}
-
-JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, JSValue slotBase, PropertyName ident)
-{
-    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
-    QW_DS(QtRuntimeMetaMethod, thisObj);
-
-    if (!d->m_connect)
-        d->m_connect.set(exec->globalData(), thisObj, QtRuntimeConnectionMethod::create(exec, ident.publicName(), true, d->m_instance, d->m_index, d->m_signature));
-    return d->m_connect.get();
-}
-
-JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, JSValue slotBase, PropertyName ident)
-{
-    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
-    QW_DS(QtRuntimeMetaMethod, thisObj);
-
-    if (!d->m_disconnect)
-        d->m_disconnect.set(exec->globalData(), thisObj, QtRuntimeConnectionMethod::create(exec, ident.publicName(), false, d->m_instance, d->m_index, d->m_signature));
-    return d->m_disconnect.get();
-}
-
-// ===============
-
-QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections;
-
-const ClassInfo QtRuntimeConnectionMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeConnectionMethod) };
-
-QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const UString& identifier)
-    : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier)
-{
-}
-
-void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const UString& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
-{
-    Base::finishCreation(exec, identifier, instance);
-    QW_D(QtRuntimeConnectionMethod);
-
-    d->m_signature = signature;
-    d->m_index = index;
-    d->m_isConnect = isConnect;
-}
-
-EncodedJSValue QtRuntimeConnectionMethod::call(ExecState* exec)
-{
-    QtRuntimeConnectionMethodData* d = static_cast<QtRuntimeConnectionMethod *>(exec->callee())->d_func();
-
-    JSLockHolder lock(exec);
-
-    QObject* sender = d->m_instance->getObject();
-
-    if (sender) {
-
-        JSObject* thisObject = exec->lexicalGlobalObject()->methodTable()->toThisObject(exec->lexicalGlobalObject(), exec);
-        JSObject* funcObject = 0;
-
-        // QtScript checks signalness first, arguments second
-        int signalIndex = -1;
-
-        // Make sure the initial index is a signal
-        QMetaMethod m = sender->metaObject()->method(d->m_index);
-        if (m.methodType() == QMetaMethod::Signal)
-            signalIndex = findSignalIndex(sender->metaObject(), d->m_index, d->m_signature);
-
-        if (signalIndex != -1) {
-            if (exec->argumentCount() == 1) {
-                funcObject = exec->argument(0).toObject(exec);
-                CallData callData;
-                if (funcObject->methodTable()->getCallData(funcObject, callData) == CallTypeNone) {
-                    if (d->m_isConnect)
-                        return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function"));
-                    else
-                        return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: target is not a function"));
-                }
-            } else if (exec->argumentCount() >= 2) {
-                if (exec->argument(0).isObject()) {
-                    thisObject = exec->argument(0).toObject(exec);
-
-                    // Get the actual function to call
-                    JSObject *asObj = exec->argument(1).toObject(exec);
-                    CallData callData;
-                    if (asObj->methodTable()->getCallData(asObj, callData) != CallTypeNone) {
-                        // Function version
-                        funcObject = asObj;
-                    } else {
-                        // Convert it to a string
-                        UString funcName = exec->argument(1).toString(exec)->value(exec);
-                        Identifier funcIdent(exec, funcName);
-
-                        // ### DropAllLocks
-                        // This is resolved at this point in QtScript
-                        JSValue val = thisObject->get(exec, funcIdent);
-                        JSObject* asFuncObj = val.toObject(exec);
-
-                        if (asFuncObj->methodTable()->getCallData(asFuncObj, callData) != CallTypeNone) {
-                            funcObject = asFuncObj;
-                        } else {
-                            if (d->m_isConnect)
-                                return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function"));
-                            else
-                                return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: target is not a function"));
-                        }
-                    }
-                } else {
-                    if (d->m_isConnect)
-                        return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: thisObject is not an object"));
-                    else
-                        return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: thisObject is not an object"));
-                }
-            } else {
-                if (d->m_isConnect)
-                    return throwVMError(exec, createError(exec, "QtMetaMethod.connect: no arguments given"));
-                else
-                    return throwVMError(exec, createError(exec, "QtMetaMethod.disconnect: no arguments given"));
-            }
-
-            if (d->m_isConnect) {
-                // to connect, we need:
-                //  target object [from ctor]
-                //  target signal index etc. [from ctor]
-                //  receiver function [from arguments]
-                //  receiver this object [from arguments]
-
-                QtConnectionObject* conn = QtConnectionObject::createWithInternalJSC(exec, d->m_instance, signalIndex, thisObject, funcObject);
-                bool ok = QMetaObject::connect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
-                if (!ok) {
-                    delete conn;
-                    QString msg = QString(QLatin1String("QtMetaMethod.connect: failed to connect to %1::%2()"))
-                            .arg(QLatin1String(sender->metaObject()->className()))
-                            .arg(QLatin1String(d->m_signature));
-                    return throwVMError(exec, createError(exec, msg.toLatin1().constData()));
-                }
-                else {
-                    // Store connection
-                    connections.insert(sender, conn);
-                }
-            } else {
-                // Now to find our previous connection object. Hmm.
-                QList<QtConnectionObject*> conns = connections.values(sender);
-                bool ret = false;
-
-                JSContextRef context = ::toRef(exec);
-                JSObjectRef receiver = ::toRef(thisObject);
-                JSObjectRef receiverFunction = ::toRef(funcObject);
-
-                foreach(QtConnectionObject* conn, conns) {
-                    // Is this the right connection?
-                    if (conn->match(context, sender, signalIndex, receiver, receiverFunction)) {
-                        // Yep, disconnect it
-                        QMetaObject::disconnect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
-                        delete conn; // this will also remove it from the map
-                        ret = true;
-                        break;
-                    }
-                }
-
-                if (!ret) {
-                    QString msg = QString(QLatin1String("QtMetaMethod.disconnect: failed to disconnect from %1::%2()"))
-                            .arg(QLatin1String(sender->metaObject()->className()))
-                            .arg(QLatin1String(d->m_signature));
-                    return throwVMError(exec, createError(exec, msg.toLatin1().constData()));
-                }
-            }
-        } else {
-            QString msg = QString(QLatin1String("QtMetaMethod.%1: %2::%3() is not a signal"))
-                    .arg(QLatin1String(d->m_isConnect ? "connect": "disconnect"))
-                    .arg(QLatin1String(sender->metaObject()->className()))
-                    .arg(QLatin1String(d->m_signature));
-            return throwVMError(exec, createTypeError(exec, msg.toLatin1().constData()));
-        }
-    } else {
-        return throwVMError(exec, createError(exec, "cannot call function of deleted QObject"));
-    }
-
-    return JSValue::encode(jsUndefined());
-}
-
-CallType QtRuntimeConnectionMethod::getCallData(JSCell*, CallData& callData)
-{
-    callData.native.function = call;
-    return CallTypeHost;
-}
-
-bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
-    QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(cell);
-    if (propertyName == exec->propertyNames().length) {
-        slot.setCustom(thisObject, thisObject->lengthGetter);
-        return true;
-    }
-
-    return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
-}
-
-bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
-    QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(object);
-    if (propertyName == exec->propertyNames().length) {
-        PropertySlot slot;
-        slot.setCustom(thisObject, lengthGetter);
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
-        return true;
-    }
-
-    return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
-
-void QtRuntimeConnectionMethod::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
-    if (mode == IncludeDontEnumProperties)
-        propertyNames.add(exec->propertyNames().length);
-
-    QtRuntimeMethod::getOwnPropertyNames(object, exec, propertyNames, mode);
-}
-
-JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState*, JSValue, PropertyName)
-{
-    // we have one formal argument, and one optional
-    return jsNumber(1);
-}
-
-// ===============
-
-QtConnectionObject::QtConnectionObject(JSContextRef context, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction)
-    : QObject(senderInstance->getObject())
-    , m_context(JSContextGetGlobalContext(context))
-    , m_senderInstance(senderInstance)
-    , m_originalSender(m_senderInstance->getObject())
-    , m_signalIndex(signalIndex)
-    , m_receiver(receiver)
-    , m_receiverFunction(receiverFunction)
-{
-    JSValueProtect(m_context, m_receiver);
-    JSValueProtect(m_context, m_receiverFunction);
-}
-
-QtConnectionObject::~QtConnectionObject()
-{
-    // We can safely use m_originalSender because connection object will never outlive the sender,
-    // which is its QObject parent.
-    QtRuntimeConnectionMethod::connections.remove(m_originalSender, this);
-
-    JSValueUnprotect(m_context, m_receiver);
-    JSValueUnprotect(m_context, m_receiverFunction);
-}
-
-static const uint qt_meta_data_QtConnectionObject[] = {
-
- // content:
-       1,       // revision
-       0,       // classname
-       0,    0, // classinfo
-       1,   10, // methods
-       0,    0, // properties
-       0,    0, // enums/sets
-
- // slots: signature, parameters, type, tag, flags
-      28,   27,   27,   27, 0x0a,
-
-       0        // eod
-};
-
-static const char qt_meta_stringdata_QtConnectionObject[] = {
-    "JSC::Bindings::QtConnectionObject\0\0execute()\0"
-};
-
-const QMetaObject QtConnectionObject::staticMetaObject = {
-    { &QObject::staticMetaObject, qt_meta_stringdata_QtConnectionObject,
-      qt_meta_data_QtConnectionObject, 0 }
-};
-
-const QMetaObject *QtConnectionObject::metaObject() const
-{
-    return &staticMetaObject;
-}
-
-void *QtConnectionObject::qt_metacast(const char *_clname)
-{
-    if (!_clname) return 0;
-    if (!strcmp(_clname, qt_meta_stringdata_QtConnectionObject))
-        return static_cast<void*>(const_cast<QtConnectionObject*>(this));
-    return QObject::qt_metacast(_clname);
-}
-
-// This is what moc would generate except by the fact that we pass all arguments to our execute() slot.
-int QtConnectionObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
-    _id = QObject::qt_metacall(_c, _id, _a);
-    if (_id < 0)
-        return _id;
-    if (_c == QMetaObject::InvokeMetaMethod) {
-        switch (_id) {
-        case 0: execute(_a); break;
-        }
-        _id -= 1;
-    }
-    return _id;
-}
-
-static bool isJavaScriptFunction(JSObjectRef object)
-{
-    CallData callData;
-    JSObject* jsObject = toJS(object);
-    return jsObject->methodTable()->getCallData(jsObject, callData) == CallTypeJS;
-}
-
-void QtConnectionObject::execute(void** argv)
-{
-    QObject* sender = m_senderInstance->getObject();
-    if (!sender) {
-        qWarning() << "sender deleted, cannot deliver signal";
-        return;
-    }
-
-    ASSERT(sender == m_originalSender);
-
-    const QMetaObject* meta = sender->metaObject();
-    const QMetaMethod method = meta->method(m_signalIndex);
-
-    QList<QByteArray> parameterTypes = method.parameterTypes();
-
-    JSValueRef* ignoredException = 0;
-    JSRetainPtr<JSStringRef> lengthProperty(JSStringCreateWithUTF8CString("length"));
-    int receiverLength = int(JSValueToNumber(m_context, JSObjectGetProperty(m_context, m_receiverFunction, lengthProperty.get(), ignoredException), ignoredException));
-    int argc = qMax(parameterTypes.count(), receiverLength);
-    WTF::Vector<JSValueRef> args(argc);
-
-    // TODO: remove once conversion functions use JSC API.
-    ExecState* exec = ::toJS(m_context);
-    RefPtr<RootObject> rootObject = m_senderInstance->rootObject();
-
-    for (int i = 0; i < argc; i++) {
-        int argType = QMetaType::type(parameterTypes.at(i));
-        args[i] = ::toRef(exec, convertQVariantToValue(exec, rootObject, QVariant(argType, argv[i+1])));
-    }
-
-    const bool updateQtSender = isJavaScriptFunction(m_receiverFunction);
-    if (updateQtSender)
-        QtInstance::qtSenderStack()->push(QObject::sender());
-
-    JSObjectCallAsFunction(m_context, m_receiverFunction, m_receiver, argc, args.data(), 0);
-
-    if (updateQtSender)
-        QtInstance::qtSenderStack()->pop();
-}
-
-bool QtConnectionObject::match(JSContextRef context, QObject* sender, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction)
-{
-    if (sender != m_originalSender || signalIndex != m_signalIndex)
-        return false;
-    JSValueRef* ignoredException = 0;
-    const bool receiverMatch = (!receiver && !m_receiver) || JSValueIsEqual(context, receiver, m_receiver, ignoredException);
-    return receiverMatch && JSValueIsEqual(context, receiverFunction, m_receiverFunction, ignoredException);
-}
-
-QtConnectionObject* QtConnectionObject::createWithInternalJSC(ExecState* exec, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObject* receiver, JSObject* receiverFunction)
-{
-    return new QtConnectionObject(::toRef(exec), senderInstance, signalIndex, ::toRef(receiver), ::toRef(receiverFunction));
-}
-
-// ===============
-
-template <typename T> QtArray<T>::QtArray(QList<T> list, QMetaType::Type type, PassRefPtr<RootObject> rootObject)
-    : Array(rootObject)
-    , m_list(list)
-    , m_type(type)
-{
-    m_length = m_list.count();
-}
-
-template <typename T> QtArray<T>::~QtArray ()
-{
-}
-
-template <typename T> RootObject* QtArray<T>::rootObject() const
-{
-    return m_rootObject && m_rootObject->isValid() ? m_rootObject.get() : 0;
-}
-
-template <typename T> void QtArray<T>::setValueAt(ExecState* exec, unsigned index, JSValue aValue) const
-{
-    // QtScript sets the value, but doesn't forward it to the original source
-    // (e.g. if you do 'object.intList[5] = 6', the object is not updated, but the
-    // copy of the list is).
-    int dist = -1;
-    QVariant val = convertValueToQVariant(exec, aValue, m_type, &dist);
-
-    if (dist >= 0) {
-        m_list[index] = val.value<T>();
-    }
-}
-
-
-template <typename T> JSValue QtArray<T>::valueAt(ExecState *exec, unsigned int index) const
-{
-    if (index < m_length) {
-        T val = m_list.at(index);
-        return convertQVariantToValue(exec, rootObject(), QVariant::fromValue(val));
-    }
-
-    return jsUndefined();
-}
-
-// ===============
-
-} }
diff --git a/Source/WebCore/editing/qt/SmartReplaceQt.cpp b/Source/WebCore/editing/qt/SmartReplaceQt.cpp
deleted file mode 100644 (file)
index 4bbb82c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>.  All rights reserved.
- * Copyright (C) 2007,2008,2009 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#if USE(QT4_UNICODE)
-#include "SmartReplace.h"
-#include <QChar>
-
-namespace WebCore {
-
-bool isCharacterSmartReplaceExempt(UChar32 c, bool isPreviousCharacter)
-{
-    QChar d(c);
-    if (d.isSpace())
-        return true;
-    if (!isPreviousCharacter && d.isPunct())
-        return true;
-
-    if ((c >= 0x1100 && c <= (0x1100 + 256)) // Hangul Jamo (0x1100 - 0x11FF)
-        || (c >= 0x2E80 && c <= (0x2E80 + 352)) // CJK & Kangxi Radicals (0x2E80 - 0x2FDF)
-        || (c >= 0x2FF0 && c <= (0x2FF0 + 464)) // Ideograph Deseriptions, CJK Symbols, Hiragana, Katakana, Bopomofo, Hangul Compatibility Jamo, Kanbun, & Bopomofo Ext (0x2FF0 - 0x31BF)
-        || (c >= 0x3200 && c <= (0x3200 + 29392)) // Enclosed CJK, CJK Ideographs (Uni Han & Ext A), & Yi (0x3200 - 0xA4CF)
-        || (c >= 0xAC00 && c <= (0xAC00 + 11183)) // Hangul Syllables (0xAC00 - 0xD7AF)
-        || (c >= 0xF900 && c <= (0xF900 + 352)) // CJK Compatibility Ideographs (0xF900 - 0xFA5F)
-        || (c >= 0xFE30 && c <= (0xFE30 + 32)) // CJK Compatibility From (0xFE30 - 0xFE4F)
-        || (c >= 0xFF00 && c <= (0xFF00 + 240)) // Half/Full Width Form (0xFF00 - 0xFFEF)
-        || (c >= 0x20000 && c <= (0x20000 + 0xA6D7)) // CJK Ideograph Exntension B
-        || (c >= 0x2F800 && c <= (0x2F800 + 0x021E))) // CJK Compatibility Ideographs (0x2F800 - 0x2FA1D)
-       return true;
-
-    const char prev[] = "([\"\'#$/-`{\0";
-    const char next[] = ")].,;:?\'!\"%*-/}\0";
-    const char* str = (isPreviousCharacter) ? prev : next;
-    for (int i = 0; i < strlen(str); ++i) {
-        if (str[i] == c)
-          return true;
-    }
-
-    return false;
-}
-
-}
-#endif
index d522229500ac15e38a6418631e86eece8e7837a6..ab759496f1b30569a154ddd7d09580735afc7441 100644 (file)
 #include "RenderWidget.h"
 #include "Scrollbar.h"
 
-#if !HAVE(QT5)
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT extern bool qt_tab_all_widgets; // from qapplication.cpp
-QT_END_NAMESPACE
-#endif
-
 namespace WebCore {
 
 #if defined(Q_WS_MAC)
@@ -66,11 +60,7 @@ const double EventHandler::TextDragDelay = 0.0;
 
 bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const
 {
-#if HAVE(QT5)
     return !isKeyboardOptionTab(event);
-#else
-    return (isKeyboardOptionTab(event) ? !qt_tab_all_widgets : qt_tab_all_widgets);
-#endif
 }
 
 void EventHandler::focusDocumentView()
index fe1223d78600d2183094ee56fa63d4391de495a6..e1373f091d185400abba166f34294ed1503853d5 100644 (file)
@@ -68,14 +68,9 @@ typedef unsigned int GLuint;
 #if PLATFORM(MAC)
 typedef CGLContextObj PlatformGraphicsContext3D;
 #elif PLATFORM(QT)
-#if HAVE(QT5)
 typedef QOpenGLContext* PlatformGraphicsContext3D;
 typedef QSurface* PlatformGraphicsSurface3D;
 #else
-typedef QGLContext* PlatformGraphicsContext3D;
-typedef QGLWidget* PlatformGraphicsSurface3D;
-#endif
-#else
 typedef void* PlatformGraphicsContext3D;
 #endif
 
index 82cc21c6d15c1957279f85ffc45c934e56bd9e57..8e54ee452b93e8c47de75d4c9d02330b12a9b1a1 100644 (file)
@@ -42,11 +42,7 @@ OpenGLFunctionTable* openGLFunctionTable()
 #if PLATFORM(QT)
 static void* getProcAddress(const char* procName)
 {
-#if HAVE(QT5)
     return reinterpret_cast<void*>(QOpenGLContext::currentContext()->getProcAddress(procName));
-#else
-    return reinterpret_cast<void*>(QGLContext::currentContext()->getProcAddress(QString::fromLatin1(procName)));
-#endif
 }
 #else
 typedef void* (*glGetProcAddressType) (const char* procName);
index 706f17d9ba67c1696f5fb7273b956287e77d5ebc..fffa502e5f6f5c21993d0c810f1db49ae64fe869 100644 (file)
 
 #if PLATFORM(QT)
 #include <qglobal.h>
-#if HAVE(QT5)
 #include <qopenglfunctions.h>
 #include <QOpenGLContext>
 #include <QSurface>
 #else
-#include <QGLContext>
-#endif
-#else
 #include <GL/gl.h>
 #endif
 
index b929e90e49f4100c4f97fce97637bbe01aaf409e..423d0cbf3ff783b1868f77393ceaf4f8113e8b79 100644 (file)
 #include <QEvent>
 #include <QTimer>
 
-#if defined(HAVE_QT5) && HAVE_QT5
 #include <QWindow>
-#else
-#include <QWidget>
-#endif
 
 namespace WebCore {
 
 class HTMLVideoElement;
 
-#if defined(HAVE_QT5) && HAVE_QT5
-typedef QWindow Base;
-#else
-typedef QWidget Base;
-#endif
-
-class FullScreenVideoWindow: public Base {
+class FullScreenVideoWindow: public QWindow {
 Q_OBJECT
 public:
     FullScreenVideoWindow();
index 3e431f2417c936d793f308bea303f43c2fbe4477..977fa3a24452242a52fdd605c8f5b10147c40e57 100644 (file)
@@ -38,11 +38,6 @@ static const int gHideMouseCursorDelay = 3000;
 FullScreenVideoWindow::FullScreenVideoWindow()
     : m_mediaElement(0)
 {
-#if !HAVE(QT5)
-    setAttribute(Qt::WA_NativeWindow);
-    setAttribute(Qt::WA_NoSystemBackground, true);
-    setAttribute(Qt::WA_PaintOnScreen, true);
-#endif
     setWindowModality(Qt::ApplicationModal);
 
 #ifndef QT_NO_CURSOR
@@ -65,7 +60,7 @@ void FullScreenVideoWindow::keyPressEvent(QKeyEvent* ev)
             m_mediaElement->play();
     } else if (ev->key() == Qt::Key_Escape)
         emit closed();
-    Base::keyPressEvent(ev);
+    QWindow::keyPressEvent(ev);
 }
 
 bool FullScreenVideoWindow::event(QEvent* ev)
@@ -83,10 +78,6 @@ bool FullScreenVideoWindow::event(QEvent* ev)
 #ifndef QT_NO_CURSOR
         m_cursorTimer.stop();
 #endif
-#if !HAVE(QT5)
-        setMouseTracking(false);
-        releaseMouse();
-#endif
 #ifndef QT_NO_CURSOR
         QGuiApplication::restoreOverrideCursor();
 #endif
@@ -94,19 +85,13 @@ bool FullScreenVideoWindow::event(QEvent* ev)
     default:
         break;
     }
-    return Base::event(ev);
+    return QWindow::event(ev);
 }
 
 void FullScreenVideoWindow::showFullScreen()
 {
-    Base::showFullScreen();
-#if !HAVE(QT5)
-    setMouseTracking(true);
-#endif
+    QWindow::showFullScreen();
     raise();
-#if !HAVE(QT5)
-    setFocus();
-#endif
     hideCursor();
 }
 
@@ -128,16 +113,10 @@ void FullScreenVideoWindow::showCursor()
 
 PlatformVideoWindow::PlatformVideoWindow()
 {
-    Base* win = new FullScreenVideoWindow();
+    QWindow* win = new FullScreenVideoWindow();
     m_window = win;
     win->setWindowFlags(win->windowFlags() | Qt::FramelessWindowHint);
     // FIXME: Port to Qt 5.
-#if !HAVE(QT5)
-    QPalette p;
-    p.setColor(QPalette::Base, Qt::black);
-    p.setColor(QPalette::Window, Qt::black);
-    win->setPalette(p);
-#endif
     win->showFullScreen();
     m_videoWindowId = win->winId();
 }
index 895f76688039e81f2f70bfad8005f077bde51d18..cb824f63c0c8b0bbc68992c9fb8b9043992b23d5 100644 (file)
 #include "OpenGLShims.h"
 #include "QWebPageClient.h"
 #include "SharedBuffer.h"
-#if HAVE(QT5)
 #include <QWindow>
 #include <qpa/qplatformpixmap.h>
-#endif
 #include <wtf/UnusedParam.h>
 #include <wtf/text/CString.h>
 
@@ -255,7 +253,6 @@ void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() con
     if (!m_context->m_attrs.antialias)
         return;
 
-#if HAVE(QT5)
     const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
     QSurface* currentSurface = 0;
     if (currentContext != m_platformContext) {
@@ -265,35 +262,14 @@ void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() con
     blitMultisampleFramebuffer();
     if (currentSurface)
         const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface);
-#else
-    const QGLContext* currentContext = QGLContext::currentContext();
-    const QGLContext* widgetContext = m_surface->context();
-    if (currentContext != widgetContext)
-        m_surface->makeCurrent();
-    blitMultisampleFramebuffer();
-    if (currentContext) {
-        if (currentContext != widgetContext)
-            const_cast<QGLContext*>(currentContext)->makeCurrent();
-    } else
-        m_surface->doneCurrent();
-#endif
 }
 
 bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const
 {
-#if HAVE(QT5)
     const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
     if (currentContext == m_platformContext)
         return true;
     return m_platformContext->makeCurrent(m_surface);
-#else
-    const QGLContext* currentContext = QGLContext::currentContext();
-    const QGLContext* widgetContext = m_surface->context();
-    if (currentContext != widgetContext)
-        m_surface->makeCurrent();
-
-    return QGLContext::currentContext() == widgetContext;
-#endif
 }
 
 void GraphicsContext3DPrivate::createGraphicsSurfaces(const IntSize& size)
index d3f507dd3449f58cc355aed19ad1d082426e8f5b..89bfd1dfa71b8db41f762e3d92554267f4550858 100644 (file)
@@ -66,7 +66,7 @@
 #include <QVector>
 #include <wtf/MathExtras.h>
 
-#if OS(WINDOWS) && HAVE(QT5)
+#if OS(WINDOWS)
 Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
 
 enum HBitmapFormat {
@@ -1470,11 +1470,7 @@ void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, boo
             GetObject(bitmap, sizeof(info), &info);
             ASSERT(info.bmBitsPixel == 32);
 
-#if HAVE(QT5)
             QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap, supportAlphaBlend ? HBitmapPremultipliedAlpha : HBitmapNoAlpha);
-#else
-            QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap, supportAlphaBlend ? QPixmap::PremultipliedAlpha : QPixmap::NoAlpha);
-#endif
             m_data->p()->drawPixmap(dstRect, pixmap);
 
             ::DeleteObject(bitmap);
index 10fe1feb6e87f4f6a682c2eec4ee07c7ebafd03a..16330a40fbb10bc4f9c9208d10d6f69ec046e783 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <math.h>
 
-#if OS(WINDOWS) && HAVE(QT5)
+#if OS(WINDOWS)
 Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
 #endif
 
@@ -299,11 +299,7 @@ void BitmapImage::checkForSolidColor()
 #if OS(WINDOWS)
 PassRefPtr<BitmapImage> BitmapImage::create(HBITMAP hBitmap)
 {
-#if HAVE(QT5)
     QImage* nativeImage = new QImage(qt_pixmapFromWinHBITMAP(hBitmap).toImage());
-#else
-    QImage* nativeImage = new QImage(QPixmap::fromWinHBITMAP(hBitmap).toImage());
-#endif
 
     return BitmapImage::create(nativeImage);
 }
index 4c01f1daca88a0cd58a2742e9ac7969bd3019193..57908656ed53a7483ff122dbcf1421a995b3902d 100644 (file)
@@ -148,12 +148,6 @@ void SimpleFontData::platformInit()
     float spaceWidth = fm.width(QLatin1Char(' '));
 #endif
 
-#if !HAVE(QT5)
-    // Qt subtracts 1 from the descent to account for the baseline,
-    // we add it back here to get correct metrics for WebKit.
-    descent += 1;
-#endif
-
     // The line spacing should always be >= (ascent + descent), but this
     // may be false in some cases due to misbehaving platform libraries.
     // Workaround from SimpleFontPango.cpp and SimpleFontFreeType.cpp
index 7793f70adeb4774e001af279a26b78d3fb70970b..3d9452b760cd405de981d5420fc6faef2f030b3e 100644 (file)
 
 #if PLATFORM(QT)
 #include <qglobal.h>
-
-#if defined(QT_OPENGL_LIB) || HAVE(QT5)
-    #if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2)
-        #define TEXMAP_OPENGL_ES_2
-    #endif
+#if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2)
+    #define TEXMAP_OPENGL_ES_2
 #endif
 #endif
 
index 86704bc15c5ac1321ea116b6279aa7cc1a7237f1..c6b1e2825c613403923615e09eccea15bdb03614 100644 (file)
 
 #if PLATFORM(QT)
 #include "NativeImageQt.h"
-#if HAVE(QT5)
 #include <QOpenGLContext>
-#else
-#include <QGLContext>
-#endif // QT_VERSION
 #elif OS(WINDOWS)
 #include <windows.h>
 #elif OS(MAC_OS_X)
@@ -62,19 +58,11 @@ namespace WebCore {
 struct TextureMapperGLData {
     struct SharedGLData : public RefCounted<SharedGLData> {
 #if PLATFORM(QT)
-#if QT_VERSION >= 0x050000
         typedef QOpenGLContext* GLContext;
         static GLContext getCurrentGLContext()
         {
             return QOpenGLContext::currentContext();
         }
-#else
-        typedef const QGLContext* GLContext;
-        static GLContext getCurrentGLContext()
-        {
-            return QGLContext::currentContext();
-        }
-#endif
 #elif OS(WINDOWS)
         typedef HGLRC GLContext;
         static GLContext getCurrentGLContext()
index 21d978674a93773ab52b5384ce26b2ec8e5cd4ca..2436003835289a0ba2a0d08d9739080a2eb34839 100644 (file)
 #include <QAccelerometerFilter>
 #include <wtf/RefPtr.h>
 
-#if !HAVE(QT5)
-using QTM_NAMESPACE::QAccelerometer;
-using QTM_NAMESPACE::QAccelerometerFilter;
-using QTM_NAMESPACE::QAccelerometerReading;
-#endif
-
 namespace WebCore {
 
 class DeviceMotionController;
index c4a22f74e2d18e67d15551e83737da6a995729a1..35029844996f95f6eef483b9fe4527d7350e9ba4 100644 (file)
 #include <QRotationFilter>
 #include <wtf/RefPtr.h>
 
-#if !HAVE(QT5)
-using QTM_NAMESPACE::QRotationFilter;
-using QTM_NAMESPACE::QRotationReading;
-using QTM_NAMESPACE::QRotationSensor;
-#endif
-
 namespace WebCore {
 
 class DeviceOrientationProviderQt : public QRotationFilter {
index 86e4ab7b62cf2a0ce6bbb014220877baa987dd2e..3dca4eee0bddeb24cf8931116fff008244a6a86f 100644 (file)
@@ -34,15 +34,7 @@ KURL::KURL(const QUrl& url)
 
 KURL::operator QUrl() const
 {
-#if !HAVE(QT5)
-    QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
-    QByteArray ba = str.toUtf8();
-
-    QUrl url = QUrl::fromEncoded(ba);
-    return url;
-#else
     return QUrl(m_string);
-#endif
 }
 
 String KURL::fileSystemPath() const
index f30472a0b94f5415df4480090a9fb9bdd1c12d39..fa2e837eaf8dd3725b9f1eb7b4f7d156de9d3053 100644 (file)
 #include "NotImplemented.h"
 #include "Widget.h"
 #include "QWebPageClient.h"
-#if HAVE(QT5)
 #include <QGuiApplication>
 #include <QScreen>
-#else
-#include <QApplication>
-#include <QDesktopWidget>
-#endif
 
 namespace WebCore {
 
@@ -71,31 +66,14 @@ static int screenNumber(Widget* w)
 
 int screenDepth(Widget* w)
 {
-#if HAVE(QT5)
     return QGuiApplication::screens().value(screenNumber(w))->depth();
-#else
-    return QApplication::desktop()->screen(screenNumber(w))->depth();
-#endif
 }
 
 int screenDepthPerComponent(Widget* w)
 {
-#if HAVE(QT5)
     int depth = QGuiApplication::primaryScreen()->depth();
     // FIXME: Use widget's screen
     Q_UNUSED(w);
-#else
-    int depth = QApplication::desktop()->screen(0)->depth();
-    if (w) {
-        QWebPageClient* client = w->root()->hostWindow()->platformPageClient();
-
-        if (client) {
-            QWidget* view = client->ownerWidget();
-            if (view)
-                depth = view->depth();
-        }
-    }
-#endif
     // An interface to establish the actual number of bits per color
     // doesn't exist in Qt, or probably at all, so use common-sense
     // values for each screen depth and assume RGB/RGBA where appropriate.
@@ -114,32 +92,20 @@ int screenDepthPerComponent(Widget* w)
 
 bool screenIsMonochrome(Widget* w)
 {
-#if HAVE(QT5)
     Q_UNUSED(w);
     // FIXME: In Qt 5 colorCount() isn't even implemented beyond returning 256 :)
     return false;
-#else
-    return QApplication::desktop()->screen(screenNumber(w))->colorCount() == 2;
-#endif
 }
 
 FloatRect screenRect(Widget* widget)
 {
-#if HAVE(QT5)
     QRect r = QGuiApplication::screens().value(screenNumber(widget))->geometry();
-#else
-    QRect r = QApplication::desktop()->screenGeometry(screenNumber(widget));
-#endif
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 
 FloatRect screenAvailableRect(Widget* widget)
 {
-#if HAVE(QT5)
     QRect r = QGuiApplication::screens().value(screenNumber(widget))->availableGeometry();
-#else
-    QRect r = QApplication::desktop()->availableGeometry(screenNumber(widget));
-#endif
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 
index 078999dc247cd81e1dba2caa997617491490286a..adef7ffd4f64a1ed36a3b42aec05b00ba7be95fb 100644 (file)
@@ -110,9 +110,7 @@ public:
     virtual void createPlatformGraphicsContext3D(PlatformGraphicsContext3D*,
                                                  PlatformGraphicsSurface3D*) = 0;
 #endif
-#if HAVE(QT5)
     virtual QWindow* ownerWindow() const;
-#endif
 
 protected:
 #ifndef QT_NO_CURSOR
index 09f518b86ffd5a5b72ed202c57a1dc00eb9102f0..f3917b8a9037613b41a7569bb1d74aeac89b3e62 100644 (file)
@@ -65,9 +65,7 @@
 #include <QFile>
 #include <QFontMetrics>
 
-#if QT_VERSION >= 0x050000
 #include <QStyleHints>
-#endif
 
 namespace WebCore {
 
diff --git a/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp b/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
deleted file mode 100644 (file)
index 0d9d48d..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "TextBreakIterator.h"
-
-#include <QtCore/qtextboundaryfinder.h>
-#include <algorithm>
-#include <qdebug.h>
-#include <wtf/Atomics.h>
-
-// #define DEBUG_TEXT_ITERATORS
-#ifdef DEBUG_TEXT_ITERATORS
-#define DEBUG qDebug
-#else
-#define DEBUG if (1) {} else qDebug
-#endif
-
-using namespace WTF;
-using namespace std;
-
-namespace WebCore {
-
-    class TextBreakIterator : public QTextBoundaryFinder {
-    public:
-        TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const QString& string)
-            : QTextBoundaryFinder(type, string)
-        { }
-        TextBreakIterator()
-            : QTextBoundaryFinder()
-        { }
-    };
-
-    TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* characters, int length)
-    {
-        if (!characters || !length)
-            return 0;
-
-        if (iterator.isValid() && type == iterator.type() && iterator.string() == QString::fromRawData(reinterpret_cast<const QChar*>(characters), length)) {
-            iterator.toStart();
-            return &iterator;
-        }
-
-        iterator = TextBreakIterator(type, QString(reinterpret_cast<const QChar*>(characters), length));
-        return &iterator;
-    }
-
-    TextBreakIterator* wordBreakIterator(const UChar* string, int length)
-    {
-        static TextBreakIterator staticWordBreakIterator;
-        return setUpIterator(staticWordBreakIterator, QTextBoundaryFinder::Word, string, length);
-    }
-
-    static TextBreakIterator* nonSharedCharacterBreakIterator;
-
-    NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
-    {
-        m_iterator = nonSharedCharacterBreakIterator;
-        bool createdIterator = m_iterator && weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), m_iterator, 0);
-        if (!createdIterator)
-            m_iterator = new TextBreakIterator();
-        if (!setUpIterator(*m_iterator, QTextBoundaryFinder::Grapheme, buffer, length)) {
-            delete m_iterator;
-            m_iterator = 0;
-        }
-    }
-
-    NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
-    {
-        if (!weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), 0, m_iterator))
-            delete m_iterator;
-    }
-
-    TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
-    {
-        static TextBreakIterator staticCursorMovementIterator;
-        return setUpIterator(staticCursorMovementIterator, QTextBoundaryFinder::Grapheme, string, length);
-    }
-
-    static TextBreakIterator* staticLineBreakIterator;
-
-    TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&)
-    {
-        TextBreakIterator* lineBreakIterator = 0;
-        if (staticLineBreakIterator) {
-            setUpIterator(*staticLineBreakIterator, QTextBoundaryFinder::Line, string, length);
-            std::swap(staticLineBreakIterator, lineBreakIterator);
-        }
-
-        if (!lineBreakIterator && string && length)
-            lineBreakIterator = new TextBreakIterator(QTextBoundaryFinder::Line, QString(reinterpret_cast<const QChar*>(string), length));
-
-        return lineBreakIterator;
-    }
-
-    void releaseLineBreakIterator(TextBreakIterator* iterator)
-    {
-        ASSERT(iterator);
-
-        if (!staticLineBreakIterator)
-            staticLineBreakIterator = iterator;
-        else
-            delete iterator;
-    }
-
-    TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
-    {
-        static TextBreakIterator staticSentenceBreakIterator;
-        return setUpIterator(staticSentenceBreakIterator, QTextBoundaryFinder::Sentence, string, length);
-
-    }
-
-    int textBreakFirst(TextBreakIterator* bi)
-    {
-        bi->toStart();
-        DEBUG() << "textBreakFirst" << bi->position();
-        return bi->position();
-    }
-
-    int textBreakNext(TextBreakIterator* bi)
-    {
-        int pos = bi->toNextBoundary();
-        DEBUG() << "textBreakNext" << pos;
-        return pos;
-    }
-
-    int textBreakPreceding(TextBreakIterator* bi, int pos)
-    {
-        bi->setPosition(pos);
-        int newpos = bi->toPreviousBoundary();
-        DEBUG() << "textBreakPreceding" << pos << newpos;
-        return newpos;
-    }
-
-    int textBreakFollowing(TextBreakIterator* bi, int pos)
-    {
-        bi->setPosition(pos);
-        int newpos = bi->toNextBoundary();
-        DEBUG() << "textBreakFollowing" << pos << newpos;
-        return newpos;
-    }
-
-    int textBreakCurrent(TextBreakIterator* bi)
-    {
-        return bi->position();
-    }
-
-    bool isTextBreak(TextBreakIterator*, int)
-    {
-        return true;
-    }
-
-    bool isWordTextBreak(TextBreakIterator*)
-    {
-        return true;
-    }
-
-}
diff --git a/Source/WebCore/plugins/qt/PluginContainerQt.cpp b/Source/WebCore/plugins/qt/PluginContainerQt.cpp
deleted file mode 100644 (file)
index 8486180..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "PluginContainerQt.h"
-
-#include "FocusController.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "Page.h"
-#include "PlatformKeyboardEvent.h"
-#include "PlatformWheelEvent.h"
-#include "PluginView.h"
-#include <QApplication>
-#include <QX11Info>
-
-using namespace WebCore;
-
-PluginClientWrapper::PluginClientWrapper(QWidget* parent, WId client)
-    : QWidget(0, Qt::Popup)
-{
-    // create a QWidget that adopts the plugin window id, do not give it
-    // a parent so that we don't end up handling events supposed to be
-    // handled by the QX11EmbedContainer.
-
-    // without the parent this will be considered a toplevel widget,
-    // and thus make Qt not quit the event loop after the last window
-    // has been closed. In order to work around this, we set the window
-    // type to Qt::Popup.
-
-    create(client, false, true);
-    m_parent = parent;
-}
-
-PluginClientWrapper::~PluginClientWrapper()
-{
-    destroy(false, false);
-}
-
-bool PluginClientWrapper::x11Event(XEvent* event)
-{
-    // modify the event window id and insert it into the Qt event system.
-    event->xany.window = m_parent->effectiveWinId();
-    static_cast<QApplication*>(QApplication::instance())->x11ProcessEvent(event);
-    return true;
-}
-
-PluginContainerQt::PluginContainerQt(PluginView* view, QWidget* parent)
-    : QX11EmbedContainer(parent)
-    , m_pluginView(view)
-    , m_clientWrapper(0)
-{
-    connect(this, SIGNAL(clientClosed()), this, SLOT(on_clientClosed()));
-    connect(this, SIGNAL(clientIsEmbedded()), this, SLOT(on_clientIsEmbedded()));
-}
-
-PluginContainerQt::~PluginContainerQt()
-{
-    delete m_clientWrapper;
-    m_pluginView->setPlatformPluginWidget(0);
-}
-
-void PluginContainerQt::on_clientClosed()
-{
-    delete m_clientWrapper;
-    m_clientWrapper = 0;
-}
-
-void PluginContainerQt::on_clientIsEmbedded()
-{
-    delete m_clientWrapper;
-    m_clientWrapper = 0;
-
-    // Only create a QWidget wrapper for the plugin in the case it isn't in the
-    // Qt window mapper, and thus receiving events from the Qt event system.
-    // This way the PluginClientWrapper receives the scroll events and passes
-    // them to the parent. NOTICE: Native Qt based plugins running in process,
-    // will already be in the window mapper, and thus creating a wrapper, stops
-    // them from getting events from Qt, as they are redirected to the wrapper.
-    if (!QWidget::find(clientWinId()))
-        m_clientWrapper = new PluginClientWrapper(this, clientWinId());
-}
-
-void PluginContainerQt::redirectWheelEventsToParent(bool enable)
-{
-    // steal wheel events from the plugin as we want to handle it. When doing this
-    // all button 4, 5, 6, and 7, ButtonPress and ButtonRelease events are passed
-    // to the x11Event handler of the PluginClientWrapper, which then changes the
-    // window id of the event to the parent of PluginContainer and puts the event
-    // back into the Qt event loop, so that we will actually scroll the parent
-    // frame.
-    for (int buttonNo = 4; buttonNo < 8; buttonNo++) {
-        if (enable)
-            XGrabButton(x11Info().display(), buttonNo, AnyModifier, clientWinId(),
-                false, ButtonPressMask, GrabModeAsync, GrabModeAsync, 0L, 0L);
-        else
-            XUngrabButton(x11Info().display(), buttonNo, AnyModifier, clientWinId());
-    }
-}
-
-bool PluginContainerQt::x11Event(XEvent* event)
-{
-    switch (event->type) {
-    case EnterNotify:
-        // if the plugin window doesn't have focus we do not want to send wheel
-        // events to it, but to the parent frame, so let's redirect here.
-        redirectWheelEventsToParent(!hasFocus());
-        break;
-    case LeaveNotify:
-        // it is always safe to ungrab wheel events when the mouse leaves the
-        // plugin window.
-        redirectWheelEventsToParent(false);
-        break;
-    }
-
-    return QX11EmbedContainer::x11Event(event);
-}
-
-void PluginContainerQt::focusInEvent(QFocusEvent* event)
-{
-    // we got focus, stop redirecting the wheel events
-    redirectWheelEventsToParent(false);
-
-    if (Page* page = m_pluginView->parentFrame()->page())
-        page->focusController()->setActive(true);
-
-    m_pluginView->focusPluginElement();
-}
-
-void PluginContainerQt::focusOutEvent(QFocusEvent*)
-{
-    if (Page* page = m_pluginView->parentFrame()->page())
-        page->focusController()->setActive(false);
-}
diff --git a/Source/WebCore/plugins/qt/PluginContainerQt.h b/Source/WebCore/plugins/qt/PluginContainerQt.h
deleted file mode 100644 (file)
index 3a2896d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-#ifndef PluginContainerQt_h
-#define PluginContainerQt_h
-
-#include <QX11EmbedContainer>
-
-namespace WebCore {
-
-    class PluginView;
-
-    class PluginContainerQt : public QX11EmbedContainer
-    {
-        Q_OBJECT
-    public:
-        PluginContainerQt(PluginView*, QWidget* parent);
-        ~PluginContainerQt();
-
-        void redirectWheelEventsToParent(bool enable = true);
-
-    protected:
-        virtual bool x11Event(XEvent*);
-        virtual void focusInEvent(QFocusEvent*);
-        virtual void focusOutEvent(QFocusEvent*);
-
-    public slots:
-        void on_clientClosed();
-        void on_clientIsEmbedded();
-
-    private:
-        PluginView* m_pluginView;
-        QWidget* m_clientWrapper;
-    };
-
-    class PluginClientWrapper : public QWidget
-    {
-    public:
-        PluginClientWrapper(QWidget* parent, WId client);
-        ~PluginClientWrapper();
-        bool x11Event(XEvent*);
-
-    private:
-        QWidget* m_parent;
-    };
-}
-
-#endif // PluginContainerQt_h
index fbac529ac5eb0f0e6255497e9ab068ac59dca731..ddab475ba91124034b832cba9d36af429abaaf46 100644 (file)
@@ -132,7 +132,6 @@ static void initializeGtk(QLibrary* module = 0)
 
 bool PluginPackage::isPluginBlacklisted()
 {
-#if HAVE(QT5)
     // TODO: enumerate all plugins that are incompatible with Qt5.
     const QLatin1String pluginBlacklist[] = {
         QLatin1String("skypebuttons")
@@ -143,7 +142,6 @@ bool PluginPackage::isPluginBlacklisted()
         if (baseName == pluginBlacklist[i])
             return true;
     }
-#endif
     return false;
 }
 
index 891d42b9789bbcd8bb79e596c7d2b7ea61951c86..04d710ea28e5d784530081b52ed7bc78d80c7905 100644 (file)
 #include <runtime/JSLock.h>
 #include <runtime/JSValue.h>
 
-#if HAVE(QT5)
 #include "QtX11ImageConversion.h"
 #include <QGuiApplication>
 #include <qpa/qplatformnativeinterface.h>
 #include <QWindow>
-#else
-#include "PluginContainerQt.h"
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QGraphicsWidget>
-#include <QStyleOptionGraphicsItem>
-#include <QWidget>
-#include <QX11Info>
-#endif
 
 using JSC::ExecState;
 #if USE(JSC)
@@ -199,13 +189,7 @@ void PluginView::updatePluginWidget()
 
 void PluginView::setFocus(bool focused)
 {
-#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet (so platformPluginWidget() is always null).
-    if (platformPluginWidget()) {
-        if (focused)
-            static_cast<QWidget*>(platformPluginWidget())->setFocus(Qt::OtherFocusReason);
-    } else
-#endif
-        Widget::setFocus(focused);
+    Widget::setFocus(focused);
 }
 
 void PluginView::show()
@@ -238,65 +222,16 @@ void PluginView::paintUsingXPixmap(QPainter* painter, const QRect &exposedRect)
     bool shouldSyncX = m_pluginDisplay && m_pluginDisplay != x11Display();
     XEvent xevent;
 
-#if HAVE(QT5)
     setupGraphicsExposeEvent(m_drawable, exposedRect, xevent);
-#else
-    QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
-    const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
-    ASSERT(drawableDepth == qtDrawable.depth());
-
-    // When printing, Qt uses a QPicture to capture the output in preview mode. The
-    // QPicture holds a reference to the X Pixmap. As a result, the print preview would
-    // update itself when the X Pixmap changes. To prevent this, we create a copy.
-    if (m_element->document()->printing())
-        qtDrawable = qtDrawable.copy();
-
-    if (m_isTransparent && drawableDepth != 32) {
-        // Attempt content propagation for drawable with no alpha by copying over from the backing store
-        QPoint offset;
-        QPaintDevice* backingStoreDevice =  QPainter::redirected(painter->device(), &offset);
-        offset = -offset; // negating the offset gives us the offset of the view within the backing store pixmap
-
-        const bool hasValidBackingStore = backingStoreDevice && backingStoreDevice->devType() == QInternal::Pixmap;
-        QPixmap* backingStorePixmap = static_cast<QPixmap*>(backingStoreDevice);
-
-        // We cannot grab contents from the backing store when painting on QGraphicsView items
-        // (because backing store contents are already transformed). What we really mean to do 
-        // here is to check if we are painting on QWebView, but let's be a little permissive :)
-        QWebPageClient* client = platformPageClient();
-        const bool backingStoreHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());
-
-        if (hasValidBackingStore && backingStorePixmap->depth() == drawableDepth 
-            && backingStoreHasUntransformedContents) {
-            GC gc = XDefaultGC(QX11Info::display(), QX11Info::appScreen());
-            XCopyArea(QX11Info::display(), backingStorePixmap->handle(), m_drawable, gc,
-                offset.x() + m_windowRect.x() + exposedRect.x(), offset.y() + m_windowRect.y() + exposedRect.y(),
-                exposedRect.width(), exposedRect.height(), exposedRect.x(), exposedRect.y());
-        } else { // no backing store, clean the pixmap because the plugin thinks its transparent
-            QPainter painter(&qtDrawable);
-            painter.fillRect(exposedRect, Qt::white);
-        }
-
-        if (shouldSyncX)
-            syncX();
-    }
-
-    setupGraphicsExposeEvent(qtDrawable.handle(), exposedRect, xevent);
-#endif
-
     dispatchNPEvent(xevent);
 
     if (shouldSyncX)
         XSync(m_pluginDisplay, false); // sync changes by plugin
 
-#if HAVE(QT5)
     XImage* xImage = XGetImage(x11Display(), m_drawable, exposedRect.x(), exposedRect.y(),
                                exposedRect.width(), exposedRect.height(), ULONG_MAX, ZPixmap);
     painter->drawImage(QPoint(exposedRect.x(), exposedRect.y()), qimageFromXImage(xImage), exposedRect);
     XDestroyImage(xImage);
-#else
-    painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect);
-#endif
 }
 
 void PluginView::paint(GraphicsContext* context, const IntRect& rect)
@@ -369,13 +304,8 @@ void setSharedXEventFields(XEvent* xEvent, QWebPageClient* pageClient)
     // NOTE: event->xany.window doesn't always respond to the .window property of other XEvent's
     // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
     // events; thus, this is right:
-#if HAVE(QT5)
     QWindow* window = pageClient ? pageClient->ownerWindow() : 0;
     xEvent->xany.window = window ? window->winId() : 0;
-#else
-    QWidget* ownerWidget = pageClient ? pageClient->ownerWidget() : 0;
-    xEvent->xany.window = ownerWidget ? ownerWidget->window()->winId() : 0;
-#endif
 }
 
 void PluginView::initXEvent(XEvent* xEvent)
@@ -606,32 +536,8 @@ void PluginView::setNPWindowIfNeeded()
         return;
     m_hasPendingGeometryChange = false;
 
-#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet
-    if (m_isWindowed) {
-        QWidget* widget = static_cast<QWidget*>(platformPluginWidget());
-        widget->setGeometry(m_windowRect);
-
-        // Cut out areas of the plugin occluded by iframe shims
-        Vector<IntRect> cutOutRects;
-        QRegion clipRegion = QRegion(m_clipRect);
-        getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
-        for (size_t i = 0; i < cutOutRects.size(); i++) {
-            cutOutRects[i].move(-frameRect().x(), -frameRect().y());
-            clipRegion = clipRegion.subtracted(QRegion(cutOutRects[i]));
-        }
-        // if setMask is set with an empty QRegion, no clipping will
-        // be performed, so in that case we hide the plugin view
-        widget->setVisible(!clipRegion.isEmpty());
-        widget->setMask(clipRegion);
-
-        m_npWindow.x = m_windowRect.x();
-        m_npWindow.y = m_windowRect.y();
-    } else
-#endif
-    {
-        m_npWindow.x = 0;
-        m_npWindow.y = 0;
-    }
+    m_npWindow.x = 0;
+    m_npWindow.y = 0;
 
     // If the width or height are null, set the clipRect to null, indicating that
     // the plugin is not visible/scrolled out.
@@ -676,11 +582,6 @@ void PluginView::setParentVisible(bool visible)
         return;
 
     Widget::setParentVisible(visible);
-
-#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
-    if (isSelfVisible() && platformPluginWidget())
-        static_cast<QWidget*>(platformPluginWidget())->setVisible(visible);
-#endif
 }
 
 NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32_t len, const char* buf)
@@ -751,12 +652,8 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
 
     case NPNVnetscapeWindow: {
         QWebPageClient* client = platformPageClient();
-#if HAVE(QT5)
         QWindow* window = client ? client->ownerWindow() : 0;
         *reinterpret_cast<XID*>(value) = window ? window->winId() : 0;
-#else
-        *reinterpret_cast<XID*>(value) = client ? client->ownerWidget()->window()->winId() : 0;
-#endif
         *result = NPERR_NO_ERROR;
         return true;
     }
@@ -776,19 +673,6 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
 
 void PluginView::invalidateRect(const IntRect& rect)
 {
-#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
-    if (m_isWindowed) {
-        if (platformWidget()) {
-            // update() will schedule a repaint of the widget so ensure
-            // its knowledge of its position on the page is up to date.
-            QWidget* w = static_cast<QWidget*>(platformWidget());
-            w->setGeometry(m_windowRect);
-            w->update(rect);
-        }
-        return;
-    }
-#endif
-
     invalidateWindowlessPluginRect(rect);
 }
 
@@ -849,12 +733,7 @@ static bool getVisualAndColormap(int depth, Visual*& visual, Colormap& colormap,
     visual = 0;
     colormap = 0;
 
-#if !HAVE(QT5) && !defined(QT_NO_XRENDER)
-    static const bool useXRender = qgetenv("QT_X11_NO_XRENDER").isNull(); // Should also check for XRender >= 0.5
-#else
-    static const bool useXRender = false;
-#endif
-    if (!useXRender && forceARGB32)
+    if (forceARGB32)
         return false;
 
     int nvi;
@@ -867,22 +746,7 @@ static bool getVisualAndColormap(int depth, Visual*& visual, Colormap& colormap,
     if (!xvi)
         return false;
 
-#if !HAVE(QT5) && !defined(QT_NO_XRENDER)
-    if (forceARGB32) {
-        for (int idx = 0; idx < nvi; ++idx) {
-            XRenderPictFormat* format = XRenderFindVisualFormat(x11Display(), xvi[idx].visual);
-            if (format->type == PictTypeDirect && format->direct.alphaMask) {
-                 visual = xvi[idx].visual;
-                 break;
-            }
-        }
-        if (!visual)
-            return false;
-    } else
-#endif
-    {
-        visual = xvi[0].visual;
-    }
+    visual = xvi[0].visual;
     ASSERT(visual);
 
     XFree(xvi);
@@ -898,50 +762,18 @@ bool PluginView::platformStart()
 
     if (!x11Environment.display) {
         Display* display;
-#if HAVE(QT5)
         display = static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("display", 0));
-#else
-        display = QX11Info::display();
-#endif
         x11Environment.display = display;
         x11Environment.screenID = XDefaultScreen(display);
         x11Environment.displayDepth = XDefaultDepth(display, x11Environment.screenID);
         x11Environment.rootWindowID = XDefaultRootWindow(display);
     }
 
-#if HAVE(QT5)
     // Windowed mode is not supported with Qt5 yet.
     if (m_isWindowed)
         return false;
-#else
-    if (m_plugin->pluginFuncs()->getvalue) {
-        PluginView::setCurrentPluginView(this);
-#if USE(JSC)
-        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonJSGlobalData());
-#endif
-        setCallingPlugin(true);
-        m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed);
-        setCallingPlugin(false);
-        PluginView::setCurrentPluginView(0);
-    }
-
-    if (m_isWindowed) {
-        QWebPageClient* client = platformPageClient();
-        if (m_needsXEmbed && client) {
-            setPlatformWidget(new PluginContainerQt(this, client->ownerWidget()));
-            // sync our XEmbed container window creation before sending the xid to plugins.
-            QApplication::syncX();
-        } else {
-            notImplemented();
-            m_status = PluginStatusCanNotLoadPlugin;
-            return false;
-        }
-    } else
-#endif // HAVE(QT5)
-    {
-        setPlatformWidget(0);
-        m_pluginDisplay = getPluginDisplay();
-    }
+    setPlatformWidget(0);
+    m_pluginDisplay = getPluginDisplay();
 
     // If the width and the height are not zero we show the PluginView.
     if (!frameRect().isEmpty())
@@ -950,47 +782,21 @@ bool PluginView::platformStart()
     NPSetWindowCallbackStruct* wsi = new NPSetWindowCallbackStruct();
     wsi->type = 0;
 
-#if !HAVE(QT5)
-    if (m_isWindowed) {
-        const QX11Info* x11Info = &static_cast<QWidget*>(platformPluginWidget())->x11Info();
-
-        wsi->display = x11Info->display();
-        wsi->visual = (Visual*)x11Info->visual();
-        wsi->depth = x11Info->depth();
-        wsi->colormap = x11Info->colormap();
-
-        m_npWindow.type = NPWindowTypeWindow;
-        m_npWindow.window = (void*)static_cast<QWidget*>(platformPluginWidget())->winId();
-        m_npWindow.width = -1;
-        m_npWindow.height = -1;
-    } else
-#endif
-    {
-#if !HAVE(QT5)
-        const QX11Info* x11Info = &QApplication::desktop()->x11Info();
-        if ((x11Info->depth() == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth))
-             && getVisualAndColormap(32, m_visual, m_colormap, /* forceARGB32 = */ true))
-            wsi->depth = 32;
-        else
-#endif
-        {
-            int depth = displayDepth();
-            bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false);
-            ASSERT_UNUSED(found, found);
-            wsi->depth = depth;
-        }
-
-        wsi->display = x11Display();
-        wsi->visual = m_visual;
-        wsi->colormap = m_colormap;
-
-        m_npWindow.type = NPWindowTypeDrawable;
-        m_npWindow.window = 0; // Not used?
-        m_npWindow.x = 0;
-        m_npWindow.y = 0;
-        m_npWindow.width = -1;
-        m_npWindow.height = -1;
-    }
+    int depth = displayDepth();
+    bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false);
+    ASSERT_UNUSED(found, found);
+    wsi->depth = depth;
+
+    wsi->display = x11Display();
+    wsi->visual = m_visual;
+    wsi->colormap = m_colormap;
+
+    m_npWindow.type = NPWindowTypeDrawable;
+    m_npWindow.window = 0; // Not used?
+    m_npWindow.x = 0;
+    m_npWindow.y = 0;
+    m_npWindow.width = -1;
+    m_npWindow.height = -1;
 
     m_npWindow.ws_info = wsi;
 
index adfd2d36b41a41676f3e9d603a2fba6c7ab1eb97..142fa830580d03afe11247123bca091b6045c554 100644 (file)
 
 #if PLATFORM(QT)
 #include "QWebPageClient.h"
-#if HAVE(QT5)
 #include <QWindow>
-#else
-#include <QWidget>
-#endif
 #endif
 
 #if PLATFORM(WX)
@@ -116,13 +112,8 @@ static inline HWND windowHandleForPageClient(PlatformPageClient client)
 #elif PLATFORM(QT)
     if (!client)
         return 0;
-#if HAVE(QT5)
     if (QWindow* window = client->ownerWindow())
         return reinterpret_cast<HWND>(window->winId());
-#else
-    if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))
-        return pluginParent->winId();
-#endif
     return 0;
 #elif PLATFORM(WX)
     if (!client)
index 61c40211434fa4472a3539774d764e5ba150af0d..3e4f4641f716e7594a633d868bf4f84cbe90b732 100644 (file)
@@ -1,3 +1,14 @@
+2012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WebKit.pri:
+        * WebKit1.pri:
+        * WebKit1.pro:
+
 2012-08-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         CUSTOM_SCHEME_HANDLER flag should depend on REGISTER_PROTOCOL_HANDLER
index a2d9d4bdf5f456a149e81b6df1ed1a479aeef594..5a8f4dfe337135a2c3af24cb00c23a553fc5458f 100644 (file)
@@ -37,7 +37,7 @@ HEADERS += \
     $$PWD/qt/Api/qwebplugindatabase_p.h \
     $$PWD/qt/Api/qhttpheader_p.h
 
-haveQt(5): contains(CONFIG, accessibility) {
+contains(CONFIG, accessibility) {
     SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp
     HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h
 }
index b16d6f130a4f597c5c73fc40a4beb86b27533b36..2bde0a3c9835c4e16e567639ccb3db861c5320d3 100644 (file)
@@ -30,22 +30,16 @@ contains(DEFINES, ENABLE_VIDEO=1):contains(DEFINES, WTF_USE_QTKIT=1) {
 }
 
 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1)|contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
-    haveQt(5) {
-        QT += sensors
-    } else {
-        CONFIG *= mobility
-        MOBILITY *= sensors
-    }
+    QT += sensors
 }
 
-contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
+contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location
 
 contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
 
 plugin_backend_xlib: PKGCONFIG += x11
 
-QT += network
-haveQt(5): QT += widgets printsupport quick
+QT += network widgets printsupport quick
 
 contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
     QT *= opengl
index 8b030bfc94acae81c2ff7ba2f746e0aabdf66a20..82cd0cd0c1d2b121885722abbdc6840f5d9ce7f9 100644 (file)
@@ -94,7 +94,7 @@ HEADERS += \
     $$PWD/qt/WebCoreSupport/PlatformStrategiesQt.h \
     $$PWD/qt/WebCoreSupport/WebEventConversion.h
 
-haveQt(5): contains(QT_CONFIG,accessibility) {
+contains(QT_CONFIG,accessibility) {
     SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp
     HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h 
 }
index 343c2a1661f0b6adcf1cfb8560c3c87eb384a0fb..3e8abbad9d8189bf6c9a2b3fdb03c9f9f86a02a6 100644 (file)
@@ -309,9 +309,7 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
     if (d->page && (event->type() == QEvent::TouchBegin
                 || event->type() == QEvent::TouchEnd
                 || event->type() == QEvent::TouchUpdate
-#if HAVE(QT5)
                 || event->type() == QEvent::TouchCancel
-#endif
        )) {
         d->page->event(event);
 
index 15fe087d61970a1abb13c64b247f8c5a997154a0..0f9f17b4838458b22022207db424560c80ab761e 100644 (file)
 #include "qwebkitglobal.h"
 #include "qwebpage.h"
 #include <QtCore/qurl.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtWidgets/qgraphicswidget.h>
-#else
-#include <QtGui/qgraphicswidget.h>
-#endif
 #include <QtGui/qevent.h>
 #include <QtGui/qicon.h>
 #include <QtGui/qpainter.h>
index dac4165e9625f7b733cc74a9eaa6321458c3bf17..8026f35d60ee6a153cf05865d9c41ec3046cd30c 100644 (file)
 #include <qregion.h>
 #include <qnetworkrequest.h>
 
-#if ENABLE(ORIENTATION_EVENTS) && !HAVE(QT5)
-QTM_USE_NAMESPACE
-#endif
-
 using namespace WebCore;
 
 // from text/qfont.cpp
@@ -650,11 +646,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;
index 6d486d50ecab68dd7089e12d2a1833c27be1e836..ca96661e35cac5266d55f0f41873c56670dc3991 100644 (file)
 #include <QtNetwork/qnetworkaccessmanager.h>
 #include "qwebkitglobal.h"
 
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-#include <QtScript/qscriptengine.h>
-#endif
-
 QT_BEGIN_NAMESPACE
 class QRect;
 class QPoint;
@@ -124,13 +120,11 @@ private:
     ~QWebFrame();
 
 public:
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     enum ValueOwnership {
         QtOwnership,
         ScriptOwnership,
         AutoOwnership
     };
-#endif
 
     QWebPage *page() const;
 
@@ -139,11 +133,7 @@ public:
     void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
     void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     void addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership = QtOwnership);
-#else
-    void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership);
-#endif
     QString toHtml() const;
     QString toPlainText() const;
     QString renderTreeDump() const;
index 2762c2be77ec945efae69c0423e5e2742e479615..42473a181f20e2fde1081db9be31b07fb1a3c70d 100644 (file)
@@ -30,9 +30,6 @@
 #include "PlatformString.h"
 #if ENABLE(ORIENTATION_EVENTS)
 #include "qorientationsensor.h"
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-using QTM_NAMESPACE::QOrientationSensor;
-#endif
 #endif // ENABLE(ORIENTATION_EVENTS).
 #include "qwebelement.h"
 #include "wtf/RefPtr.h"
index 8e9633d1897f8b231ad33029c1c24fe111c1f668..08e86183a6b6ea44087ef2471fd9002d4b6040f4 100644 (file)
 #include "SystemInfo.h"
 #endif // Q_OS_WIN32
 #include "TextIterator.h"
-#include "UtilsQt.h"
 #include "WebEventConversion.h"
 #include "WindowFeatures.h"
 #include "WorkerThread.h"
@@ -3162,9 +3161,7 @@ bool QWebPage::event(QEvent *ev)
     case QEvent::TouchBegin:
     case QEvent::TouchUpdate:
     case QEvent::TouchEnd:
-#if HAVE(QT5)
     case QEvent::TouchCancel:
-#endif
         // Return whether the default action was cancelled in the JS event handler
         return d->touchEvent(static_cast<QTouchEvent*>(ev));
 #ifndef QT_NO_PROPERTIES
index 0bf35e2471f1cc3bd447c13cb0f888a52f4d4a18..66f89609b00384cbaf9a90e160d9d7b170d0d052 100644 (file)
 
 #include <QtCore/qobject.h>
 #include <QtCore/qurl.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtWidgets/qwidget.h>
-#else
-#include <QtGui/qwidget.h>
-#endif
 
 QT_BEGIN_NAMESPACE
 class QNetworkProxy;
index 588dcf7aa5ce585b2820a5ca0fd3fe82d83d0160..774da5d310f1e5ecebf473681d0860bd917de179 100644 (file)
 #include "FileSystem.h"
 
 #include <QApplication>
-#if HAVE(QT5)
 #include <QStandardPaths>
-#else
-#include <QDesktopServices>
-#endif
 #include <QDir>
 #include <QHash>
 #include <QSharedData>
@@ -1145,11 +1141,7 @@ void QWebSettings::enablePersistentStorage(const QString& path)
 
     if (path.isEmpty()) {
 
-#if HAVE(QT5)
         storagePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
-#else
-        storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-#endif
         if (storagePath.isEmpty())
             storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
     } else
@@ -1168,11 +1160,7 @@ void QWebSettings::enablePersistentStorage(const QString& path)
 #if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
     // All applications can share the common QtWebkit cache file(s).
     // Path is not configurable and uses QDesktopServices::CacheLocation by default.
-#if HAVE(QT5)
     QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
-#else
-    QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
-#endif
     WebCore::makeAllDirectories(cachePath);
 
     QFileInfo info(cachePath);
index a6082cf6328d16506fe8b9e7ea6db280890d826d..f90790f0c4b7b4f91fecd6ef4330e57d4ca3ad6a 100644 (file)
 #include "qdir.h"
 #include "qfile.h"
 #ifndef QT_NO_ACCESSIBILITY
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include "qwebviewaccessible_p.h"
 #endif
-#endif
 
 class QWebViewPrivate {
 public:
@@ -154,7 +152,6 @@ void QWebViewPrivate::_q_pageDestroyed()
 */
 
 #ifndef QT_NO_ACCESSIBILITY
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 static QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* object)
 {
     Q_UNUSED(key)
@@ -168,7 +165,6 @@ static QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObj
     return 0;
 }
 #endif
-#endif
 
 /*!
     Constructs an empty QWebView with parent \a parent.
@@ -191,10 +187,8 @@ QWebView::QWebView(QWidget *parent)
     setFocusPolicy(Qt::WheelFocus);
 
 #ifndef QT_NO_ACCESSIBILITY
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     QAccessible::installFactory(accessibleInterfaceFactory);
 #endif
-#endif
 }
 
 /*!
@@ -732,9 +726,7 @@ bool QWebView::event(QEvent *e)
         } else if (e->type() == QEvent::TouchBegin 
                    || e->type() == QEvent::TouchEnd 
                    || e->type() == QEvent::TouchUpdate
-#if HAVE(QT5)
                    || e->type() == QEvent::TouchCancel
-#endif
                   ) {
             d->page->event(e);
 
index 90d0a8e3b20714eceb1e18232b9400adc4357340..d4b4dd9175f0d181cf2bd8b5cda18198a5127f13 100644 (file)
 
 #include "qwebkitglobal.h"
 #include "qwebpage.h"
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtWidgets/qwidget.h>
-#else
-#include <QtGui/qwidget.h>
-#endif
 #include <QtGui/qicon.h>
 #include <QtGui/qpainter.h>
 #include <QtCore/qurl.h>
index 60fd350f230c081325caa1ad923ea02c24c45dd7..650ce7ba1f2e23a30613f54512b8ab50ab962a5f 100644 (file)
@@ -1,3 +1,51 @@
+2012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::sceneEvent):
+        * Api/qgraphicswebview.h:
+        * Api/qwebframe.cpp:
+        * Api/qwebframe.h:
+        * Api/qwebframe_p.h:
+        * Api/qwebpage.cpp:
+        (QWebPage::event):
+        * Api/qwebpage.h:
+        * Api/qwebsettings.cpp:
+        (QWebSettings::enablePersistentStorage):
+        * Api/qwebview.cpp:
+        (QWebView::QWebView):
+        (QWebView::event):
+        * Api/qwebview.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::setToolTip):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createPlugin):
+        * WebCoreSupport/GeolocationClientQt.cpp:
+        * WebCoreSupport/GeolocationClientQt.h:
+        * WebCoreSupport/PageClientQt.cpp:
+        (createPlatformGraphicsContext3DFromWidget):
+        (QWebPageClient::ownerWindow):
+        * WebCoreSupport/WebEventConversion.cpp:
+        (WebCore::WebKitPlatformTouchEvent::WebKitPlatformTouchEvent):
+        * declarative/declarative.pro:
+        * declarative/plugin.cpp:
+        * declarative/public.pri:
+        * examples/platformplugin/WebPlugin.cpp:
+        (WebPlugin::createExtension):
+        * examples/platformplugin/WebPlugin.h:
+        (WebPlugin):
+        * examples/platformplugin/platformplugin.pro:
+        * tests/qobjectbridge/tst_qobjectbridge.cpp:
+        (tst_QObjectBridge::arrayObjectEnumerable):
+        (tst_QObjectBridge::ownership):
+        (tst_QObjectBridge::qObjectWrapperWithSameIdentity):
+        * tests/tests.pri:
+        * tests/util.h:
+
 2012-08-01  Zeno Albisser  <zeno@webkit.org>
 
         [Qt]REGRESSION(r123786): It made 3 fast/animation tests fail.
index 29412f70475163c15c40f3f6d775d2064a8ca1b6..912320ccdda62a48b72ec73632b21760ec2a1e2f 100644 (file)
@@ -75,7 +75,6 @@
 #include <qeventloop.h>
 #include <qtooltip.h>
 #include <wtf/OwnPtr.h>
-#include <wtf/qt/UtilsQt.h>
 
 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))
 #include "FullScreenVideoQt.h"
@@ -549,7 +548,7 @@ void ChromeClientQt::setToolTip(const String &tip, TextDirection)
         view->setToolTip(QString());
         QToolTip::hideText();
     } else {
-        QString dtip = QLatin1String("<p>") + escapeHtml(tip) + QLatin1String("</p>");
+        QString dtip = QLatin1String("<p>") + QString(tip).toHtmlEscaped() + QLatin1String("</p>");
         view->setToolTip(dtip);
     }
 #else
index a2c3cb21045c104dc000e568cd51fd3abc1fdc70..4a1472c5a5775111fc93504c14bf370a36caa2a3 100644 (file)
@@ -1604,22 +1604,13 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
         Vector<String> params = paramNames;
         Vector<String> values = paramValues;
         if (mimeType == "application/x-shockwave-flash") {
-#if HAVE(QT5)
-            const bool shouldInjectWmode = true;
-#else
             // Inject wmode=opaque when there is no client or the client is not a QWebView.
-            QWebPageClient* client = m_webFrame->page()->d->client.get();
-            const bool shouldInjectWmode = !(client && qobject_cast<QWidget*>(client->pluginParent()));
-#endif
-            if (shouldInjectWmode) {
-                // Inject wmode=opaque when there is no client or the client is not a QWebView.
-                size_t wmodeIndex = params.find("wmode");
-                if (wmodeIndex == WTF::notFound) {
-                    params.append("wmode");
-                    values.append("opaque");
-                } else if (equalIgnoringCase(values[wmodeIndex], "window"))
-                    values[wmodeIndex] = "opaque";
-            }
+            size_t wmodeIndex = params.find("wmode");
+            if (wmodeIndex == WTF::notFound) {
+                params.append("wmode");
+                values.append("opaque");
+            } else if (equalIgnoringCase(values[wmodeIndex], "window"))
+                values[wmodeIndex] = "opaque";
         }
 
         RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url,
index 20ba353bd094322fd56af987cb653d67b52e4a1a..b6b4d70bd10a87c8319fe1978c769d12b6999386 100644 (file)
 #include "qwebpage.h"
 #include "qwebpage_p.h"
 
-#if !HAVE(QT5)
-#include <QGeoPositionInfoSource>
-#elif HAVE(QT5)
 #include <QtLocation/QGeoPositionInfoSource>
-#endif
 
 namespace WebCore {
 
index 726be157a377a62ee5e9f182053c748db3d0887f..2e94bdebc2bd578d5f1f41fcf6b1b03303832af2 100644 (file)
 #include <QObject>
 #include <wtf/RefPtr.h>
 
-#if !HAVE(QT5)
-#include <QGeoPositionInfo>
-namespace QtMobility {
-class QGeoPositionInfoSource;
-};
-using namespace QtMobility;
-#elif HAVE(QT5)
 #include <QtLocation/QGeoPositionInfo>
 QT_BEGIN_NAMESPACE
 class QGeoPositionInfoSource;
 QT_END_NAMESPACE
-#endif
 
 
 class QWebPage;
index 99017990654ed21c50751aa20b5af1620eb491c0..0093187af5ec4e197226458afa492b608478823a 100644 (file)
@@ -33,9 +33,7 @@
 #endif
 
 #if USE(3D_GRAPHICS)
-#if HAVE(QT5)
 #include <QWindow>
-#endif
 
 static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformGraphicsContext3D* context,
                                                       PlatformGraphicsSurface3D* surface)
@@ -54,13 +52,8 @@ static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformG
     if (glWidget->isValid()) {
         // Geometry can be set to zero because m_glWidget is used only for its QGLContext.
         glWidget->setGeometry(0, 0, 0, 0);
-#if HAVE(QT5)
         *surface = glWidget->windowHandle();
         *context = glWidget->context()->contextHandle();
-#else
-        *surface = glWidget;
-        *context = const_cast<QGLContext*>(glWidget->context());
-#endif
     } else {
         delete glWidget;
         glWidget = 0;
@@ -74,7 +67,6 @@ static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformG
 #include "texmap/TextureMapperLayer.h"
 #endif
 
-#if HAVE(QT5)
 QWindow* QWebPageClient::ownerWindow() const
 {
     QWidget* widget = ownerWidget();
@@ -86,7 +78,6 @@ QWindow* QWebPageClient::ownerWindow() const
         return nativeParent->windowHandle();
     return 0;
 }
-#endif
 
 namespace WebCore {
 
index 0b732a4ced1df4fb49a921e92cd4c88126dfa320..2226766209019d970861d203fa5cec1d58535436 100644 (file)
@@ -243,11 +243,9 @@ WebKitPlatformTouchEvent::WebKitPlatformTouchEvent(QTouchEvent* event)
     case QEvent::TouchEnd:
         m_type = PlatformEvent::TouchEnd;
         break;
-#if HAVE(QT5)
     case QEvent::TouchCancel:
         m_type = PlatformEvent::TouchCancel;
         break;
-#endif
     }
 
     const QList<QTouchEvent::TouchPoint>& points = event->touchPoints();
index 73792833868c231fa94db68b562f76ef500f14c7..04f2298d0e821bff8a3b4cafcfabfdd77914b2c9 100644 (file)
@@ -11,7 +11,7 @@ public_api.file = public.pri
 public_api.makefile = Makefile.declarative.public
 SUBDIRS += public_api
 
-haveQt(5):!no_webkit2 {
+!no_webkit2 {
     experimental_api.file = experimental/experimental.pri
     experimental_api.makefile = Makefile.declarative.experimental
     SUBDIRS += experimental_api
index 1d44be23ff507acb3658903b6844d60811949feb..db748952ab53087980d949baa55697c1e4827c89 100644 (file)
 #include "qdeclarativewebview_p.h"
 #endif
 
-#if (HAVE(QT5))
 #include <QtQml/qqml.h>
 #include <QtQml/qqmlextensionplugin.h>
-#else
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#endif
 
 #if defined(HAVE_WEBKIT2)
 #include "private/qquickwebpage_p.h"
 
 QT_BEGIN_NAMESPACE
 
-#if QT_VERSION >= 0x050000
 class WebKitQmlPlugin : public QQmlExtensionPlugin {
     Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "plugin.json")
-#else
-class WebKitQmlPlugin : public QDeclarativeExtensionPlugin {
-#endif
     Q_OBJECT
 public:
 #if defined(HAVE_WEBKIT2)
@@ -88,7 +79,3 @@ public:
 QT_END_NAMESPACE
 
 #include "plugin.moc"
-
-#if QT_VERSION < 0x050000
-Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
-#endif
index 34c66399f78b899efc03f1f4c9ce96dbe1595a46..e5c43db065fbe292e5edcdc4da9207ef5a834464 100644 (file)
@@ -24,9 +24,7 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
 
 wince*:LIBS += $$QMAKE_LIBS_GUI
 
-QT += webkit webkit-private
-haveQt(4): QT += declarative
-haveQt(5): QT += widgets quick quick-private
+QT += webkit webkit-private widgets quick quick-private
 
 contains(DEFINES, HAVE_QQUICK1=1) {
     SOURCES += qdeclarativewebview.cpp
index fdd990f57d89c0f0cf2d33288fdca22ba29699fa..c71751177ccbdbcaff449759c0374cb0e977f0b6 100644 (file)
@@ -314,7 +314,3 @@ QObject* WebPlugin::createExtension(Extension extension) const
         return 0;
     }
 }
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
-#endif
index de06f4a849280e51cb751090f2bccdc697283daf..446d0f754ded6dab0e43f3884bfbaa9f31a516e2 100644 (file)
@@ -139,9 +139,7 @@ class WebPlugin : public QObject, public QWebKitPlatformPlugin
 {
     Q_OBJECT
     Q_INTERFACES(QWebKitPlatformPlugin)
-#if QT_VERSION >= 0x050000
     Q_PLUGIN_METADATA(IID "org.qt-project.QtWebKit.PlatformPluginInterface")
-#endif
 public:
     virtual bool supportsExtension(Extension extension) const;
     virtual QObject* createExtension(Extension extension) const;
index b5da71ca0aaba64f2c6002cfc3efed859195083e..fc533d3bb5369f9e85476b952276204bb80c615c 100644 (file)
@@ -1,8 +1,7 @@
 TEMPLATE = lib
 TARGET = platformplugin
 
-QT += core gui
-haveQt(5): QT += widgets
+QT += core gui widgets
 CONFIG += plugin
 
 ## load mobilityconfig if mobility is available
index 291f9b294c4980ce7ad6dcbdded3dee1d5a57c77..cb0fdb91e235337f43c42799283831f2e861bfda 100644 (file)
@@ -37,12 +37,6 @@ Q_DECLARE_METATYPE(Qt::BrushStyle)
 Q_DECLARE_METATYPE(QVariantList)
 Q_DECLARE_METATYPE(QVariantMap)
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#define OwnershipClass QWebFrame
-#else
-#define OwnershipClass QScriptEngine
-#endif
-
 class MyQObject : public QObject {
     Q_OBJECT
 
@@ -2000,7 +1994,7 @@ void tst_QObjectBridge::arrayObjectEnumerable()
     QWebPage page;
     QWebFrame* frame = page.mainFrame();
     QObject* qobject = new StringListTestObject();
-    frame->addToJavaScriptWindowObject("test", qobject, OwnershipClass::ScriptOwnership);
+    frame->addToJavaScriptWindowObject("test", qobject, QWebFrame::ScriptOwnership);
 
     const QString script("var stringArray = test.stringList();"
                          "var result = '';"
@@ -2041,7 +2035,7 @@ void tst_QObjectBridge::ownership()
         {
             QWebPage page;
             QWebFrame* frame = page.mainFrame();
-            frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::ScriptOwnership);
+            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::ScriptOwnership);
         }
         QVERIFY(!ptr);
     }
@@ -2052,7 +2046,7 @@ void tst_QObjectBridge::ownership()
         {
             QWebPage page;
             QWebFrame* frame = page.mainFrame();
-            frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::QtOwnership);
+            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::QtOwnership);
         }
         QVERIFY(ptr.data() == before);
         delete ptr.data();
@@ -2062,7 +2056,7 @@ void tst_QObjectBridge::ownership()
         QObject* child = new QObject(parent);
         QWebPage page;
         QWebFrame* frame = page.mainFrame();
-        frame->addToJavaScriptWindowObject("test", child, OwnershipClass::QtOwnership);
+        frame->addToJavaScriptWindowObject("test", child, QWebFrame::QtOwnership);
         QVariant v = frame->evaluateJavaScript("test");
         QCOMPARE(qvariant_cast<QObject*>(v), child);
         delete parent;
@@ -2075,7 +2069,7 @@ void tst_QObjectBridge::ownership()
         {
             QWebPage page;
             QWebFrame* frame = page.mainFrame();
-            frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::AutoOwnership);
+            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::AutoOwnership);
         }
         // no parent, so it should be like ScriptOwnership
         QVERIFY(!ptr);
@@ -2087,7 +2081,7 @@ void tst_QObjectBridge::ownership()
         {
             QWebPage page;
             QWebFrame* frame = page.mainFrame();
-            frame->addToJavaScriptWindowObject("test", child.data(), OwnershipClass::AutoOwnership);
+            frame->addToJavaScriptWindowObject("test", child.data(), QWebFrame::AutoOwnership);
         }
         // has parent, so it should be like QtOwnership
         QVERIFY(child);
@@ -2129,7 +2123,7 @@ void tst_QObjectBridge::qObjectWrapperWithSameIdentity()
     QWebFrame* mainFrame = m_view->page()->mainFrame();
     QCOMPARE(mainFrame->toPlainText(), QString("test"));
 
-    mainFrame->addToJavaScriptWindowObject("test", new TestFactory, OwnershipClass::ScriptOwnership);
+    mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QWebFrame::ScriptOwnership);
 
     mainFrame->evaluateJavaScript("triggerBug();");
     QCOMPARE(mainFrame->toPlainText(), QString("test1"));
index 90c61f093e9e4691a029b43bbd15ba8bf26af741..5437baacc9cabac613d574917f24340d832bbaae 100644 (file)
@@ -16,10 +16,7 @@ INCLUDEPATH += \
     $$PWD \
     $$PWD/../Api
 
-QT += testlib network webkit
-haveQt(5): QT += widgets
-
-haveQt(4): haveQtModule(declarative): QT += declarative
+QT += testlib network webkit widgets
 
 # This define is used by some tests to look up resources in the source tree
 DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
index cfa22eb08309ef80b7e317ddd3e6747ec53b3c08..2869440cbc9f3161628b1ee4a8930a227a73bed8 100644 (file)
@@ -53,37 +53,4 @@ static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
     return timeoutSpy.isEmpty();
 }
 
-#if !(defined(HAVE_QT5) && HAVE_QT5)
-// Will try to wait for the condition while allowing event processing
-#define QTRY_VERIFY(__expr) \
-    do { \
-        const int __step = 50; \
-        const int __timeout = 5000; \
-        if (!(__expr)) { \
-            QTest::qWait(0); \
-        } \
-        for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
-            QTest::qWait(__step); \
-        } \
-        QVERIFY(__expr); \
-    } while(0)
-
-// Will try to wait for the condition while allowing event processing
-#define QTRY_COMPARE(__expr, __expected) \
-    do { \
-        const int __step = 50; \
-        const int __timeout = 5000; \
-        if ((__expr) != (__expected)) { \
-            QTest::qWait(0); \
-        } \
-        for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
-            QTest::qWait(__step); \
-        } \
-        QCOMPARE(__expr, __expected); \
-    } while(0)
-
-// Compatibility for Qt5
-#define W_QSKIP(a, b) QSKIP(a, b)
-#else
 #define W_QSKIP(a, b) QSKIP(a)
-#endif
index 6d4997607d268faa28a28c182ada38d01db5d631..3e73ee80f7538e75e185ea271686bf637abaf368 100644 (file)
@@ -1,3 +1,15 @@
+2012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:
+        (gatherAPI):
+        * WebKit2.pri:
+
 2012-08-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         [EFL][WK2] Add back forward list API
index cf640daa028e4ef432e29ffb4790c184588bb0e8..2900d0d24c14e8753d36b1c50b5c56788435c29b 100644 (file)
@@ -32,7 +32,6 @@
 #include "QtWebPageEventHandler.h"
 #include "QtWebPageLoadClient.h"
 #include "QtWebPagePolicyClient.h"
-#include "UtilsQt.h"
 #include "WebBackForwardList.h"
 #include "WebInspectorProxy.h"
 #include "WebInspectorServer.h"
index 0e3b33cf7009dbeadf2554ac414a40c0055e0b45..12e0ab9036af69e13e2c44aa5beef8e7e3b8f519 100644 (file)
@@ -144,11 +144,7 @@ static void gatherAPI(const QString& prefix, const QMetaMethod& method, QStringL
 {
     if (method.access() != QMetaMethod::Private) {
         const char* methodTypeName = !!strlen(method.typeName()) ? method.typeName() : "void";
-#if HAVE(QT5)
         *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(QString::fromLatin1(method.methodSignature())).arg(QString::fromLatin1(methodTypeName));
-#else
-        *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(method.signature()).arg(methodTypeName);
-#endif
 
         checkKnownType(methodTypeName);
         foreach (QByteArray paramType, method.parameterTypes())
index 4f48c7a44f617f7544a4b67a0e9f8108ffd83969..575caef709bc3ab3867a332fb432e0b284debb28 100644 (file)
@@ -77,4 +77,4 @@ linux-*: {
 
 QT += qml quick
 
-contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
+contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location
index 61984d24476f1d84923b7a01c2db9d454391113c..7e53cc99d4a1b8710510bddcae55b7d2b1eff985 100644 (file)
@@ -9,71 +9,64 @@ TARGET = QtWebKit
 
 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
 
-haveQt(5) {
-    # Use Qt5's module system
-    load(qt_build_config)
-    MODULE = webkit
-    MODULE_PRI = ../Tools/qmake/qt_webkit.pri
-
-    # ---------------- Custom developer-build handling -------------------
-    #
-    # The assumption for Qt developer builds is that the module file
-    # will be put into qtbase/mkspecs/modules, and the libraries into
-    # qtbase/lib, with rpath/install_name set to the Qt lib dir.
-    #
-    # For WebKit we don't want that behavior for the libraries, as we want
-    # them to be self-contained in the WebKit build dir.
-    #
-    CONFIG += force_independent
-
-    BASE_TARGET = $$TARGET
-
-    load(qt_module_config)
-
-    # Make sure the module config doesn't override our preferred build config.
-    debug_and_release:if(!debug|!release) {
-        # Removing debug_and_release causes issues with lib suffixes when building debug on Windows.
-        # Work around it by only removing build_all, and still create the Makefiles for both configurations.
-        win32*: CONFIG -= build_all
-        else: CONFIG -= debug_and_release
-    }
+# Use Qt5's module system
+load(qt_build_config)
+MODULE = webkit
+MODULE_PRI = ../Tools/qmake/qt_webkit.pri
 
-    # Allow doing a debug-only build of WebKit (not supported by Qt)
-    macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
-
-    # Make sure the install_name of the QtWebKit library point to webkit
-    macx {
-        # We do our own absolute path so that we can trick qmake into
-        # using the webkit build path instead of the Qt install path.
-        CONFIG -= absolute_library_soname
-        QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
-
-        !debug_and_release|build_pass {
-            # We also have to make sure the install_name is correct when
-            # the library is installed.
-            change_install_name.depends = install_target
-
-            # The install rules generated by qmake for frameworks are busted in
-            # that both the debug and the release makefile copy QtWebKit.framework
-            # into the install dir, so whatever changes we did to the release library
-            # will get overwritten when the debug library is installed. We work around
-            # that by running install_name on both, for both configs.
-            change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
-                for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
-                    install_name_tool -id \$\$file \$\$file; \
-                done
-            default_install_target.target = install
-            default_install_target.depends += change_install_name
-
-            QMAKE_EXTRA_TARGETS += change_install_name default_install_target
-        }
-    }
-} else {
-    VERSION = $$QT_VERSION
-    DESTDIR = $$WEBKIT_DESTDIR
+# ---------------- Custom developer-build handling -------------------
+#
+# The assumption for Qt developer builds is that the module file
+# will be put into qtbase/mkspecs/modules, and the libraries into
+# qtbase/lib, with rpath/install_name set to the Qt lib dir.
+#
+# For WebKit we don't want that behavior for the libraries, as we want
+# them to be self-contained in the WebKit build dir.
+#
+CONFIG += force_independent
+
+BASE_TARGET = $$TARGET
+
+load(qt_module_config)
+
+# Make sure the module config doesn't override our preferred build config.
+debug_and_release:if(!debug|!release) {
+    # Removing debug_and_release causes issues with lib suffixes when building debug on Windows.
+    # Work around it by only removing build_all, and still create the Makefiles for both configurations.
+    win32*: CONFIG -= build_all
+    else: CONFIG -= debug_and_release
 }
 
-runSyncQt() # Generate forwarding headers for the QtWebKit API
+# Allow doing a debug-only build of WebKit (not supported by Qt)
+macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
+
+# Make sure the install_name of the QtWebKit library point to webkit
+macx {
+    # We do our own absolute path so that we can trick qmake into
+    # using the webkit build path instead of the Qt install path.
+    CONFIG -= absolute_library_soname
+    QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
+
+    !debug_and_release|build_pass {
+        # We also have to make sure the install_name is correct when
+        # the library is installed.
+        change_install_name.depends = install_target
+
+        # The install rules generated by qmake for frameworks are busted in
+        # that both the debug and the release makefile copy QtWebKit.framework
+        # into the install dir, so whatever changes we did to the release library
+        # will get overwritten when the debug library is installed. We work around
+        # that by running install_name on both, for both configs.
+        change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
+            for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
+                install_name_tool -id \$\$file \$\$file; \
+            done
+        default_install_target.target = install
+        default_install_target.depends += change_install_name
+
+        QMAKE_EXTRA_TARGETS += change_install_name default_install_target
+    }
+}
 
 WEBKIT += wtf
 
@@ -91,52 +84,3 @@ WEBKIT += webcore
 }
 
 !no_webkit1: WEBKIT += webkit1
-
-# ------------- Install rules -------------
-
-haveQt(5) {
-    # Install rules handled by Qt's module system
-} else {
-    # For Qt4 we have to set up install rules manually
-
-    # Syncqt has already run at this point, so we can use headers.pri
-    # as a basis for our install-rules
-    HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
-    !include($$HEADERS_PRI): error(Failed to resolve install headers)
-
-    headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
-    !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
-    else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
-    INSTALLS += headers
-
-    !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
-    else: target.path = $$[QT_INSTALL_LIBS]
-    INSTALLS += target
-
-    unix {
-        CONFIG += create_pc create_prl
-        QMAKE_PKGCONFIG_LIBDIR = $$target.path
-        QMAKE_PKGCONFIG_INCDIR = $$headers.path
-        QMAKE_PKGCONFIG_DESTDIR = pkgconfig
-        lib_replace.match = $$re_escape($$DESTDIR)
-        lib_replace.replace = $$[QT_INSTALL_LIBS]
-        QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
-    }
-
-    mac {
-        !static:contains(QT_CONFIG, qt_framework) {
-            # Build QtWebKit as a framework, to match how Qt was built
-            CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
-
-            # For debug_and_release configs, only copy headers in release
-            !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
-                FRAMEWORK_HEADERS.version = Versions
-                FRAMEWORK_HEADERS.files = $${headers.files}
-                FRAMEWORK_HEADERS.path = Headers
-                QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
-            }
-        }
-
-        QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
-    }
-}
index 278d54d508eefb85633a9d5dfdd0f95b35e2ad75..2c70587a20f3e339f5137cc0006a2770268e5bb4 100644 (file)
@@ -1,3 +1,32 @@
+2012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Remove Qt 4 specific code paths
+        https://bugs.webkit.org/show_bug.cgi?id=88161
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/EventSenderQt.cpp:
+        (EventSender::touchCancel):
+        (EventSender::sendTouchEvent):
+        * DumpRenderTree/qt/EventSenderQt.h:
+        (EventSender):
+        * DumpRenderTree/qt/ImageDiff.pro:
+        * DumpRenderTree/qt/main.cpp:
+        (main):
+        * QtTestBrowser/QtTestBrowser.pro:
+        * QtTestBrowser/cookiejar.cpp:
+        (TestBrowserCookieJar::TestBrowserCookieJar):
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::setDiskCache):
+        * qmake/configure.pri:
+        * qmake/mkspecs/features/default_post.prf:
+        * qmake/mkspecs/features/default_pre.prf:
+        * qmake/mkspecs/features/features.prf:
+        * qmake/mkspecs/features/functions.prf:
+        * qmake/mkspecs/features/qtwebkit.prf: Removed.
+        * qmake/mkspecs/features/unix/default_pre.prf:
+
 2012-08-07  Andras Becsi  <andras.becsi@nokia.com>
 
         [Qt][WK2] MiniBrowser should only synthesize multiple touch points if Ctrl is pressed
index 89122dfabf3f6f7491c29186b621221366446f04..6cd068ccfabb0847c1694248ef53646fd4f76eca 100644 (file)
@@ -18,9 +18,8 @@ INCLUDEPATH += \
     $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \
     $${ROOT_WEBKIT_DIR}/Source/WTF
 
-QT = core gui network testlib webkit
+QT = core gui network testlib webkit widgets printsupport
 macx: QT += xml
-haveQt(5): QT += widgets printsupport
 
 contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig
 
index c0506efe2de31ad0edf9c2dc890b646fa6866deb..1caa4ace7e39566a7b771568fa29fbb7e2dedecf 100644 (file)
@@ -477,13 +477,11 @@ void EventSender::touchEnd()
     m_touchActive = false;
 }
 
-#if QT_VERSION >= 0x050000
 void EventSender::touchCancel()
 {
     sendTouchEvent(QEvent::TouchCancel);
     m_touchActive = false;
 }
-#endif
 
 void EventSender::clearTouchPoints()
 {
@@ -511,7 +509,6 @@ void EventSender::cancelTouchPoint(int index)
 
 void EventSender::sendTouchEvent(QEvent::Type type)
 {
-#if HAVE(QT5)
     static QTouchDevice* device = 0;
     if (!device) {
         device = new QTouchDevice;
@@ -520,9 +517,6 @@ void EventSender::sendTouchEvent(QEvent::Type type)
     }
 
     QTouchEvent event(type, device, m_touchModifiers);
-#else
-    QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
-#endif
     event.setTouchPoints(m_touchPoints);
     sendEvent(m_page, &event);
     QList<QTouchEvent::TouchPoint>::Iterator it = m_touchPoints.begin();
index 2ca1b1184909d4c4dc4a9b6c53e26c2801dcc8a8..4ec6f92bb64cc28de6724d0bfd322c47d94361c6 100644 (file)
@@ -74,9 +74,7 @@ public slots:
     void touchStart();
     void touchMove();
     void touchEnd();
-#if QT_VERSION >= 0x050000
     void touchCancel();
-#endif
     void zoomPageIn();
     void zoomPageOut();
     void textZoomIn();
index 729ec259af0d7845bd93308e088b115d223cb29c..40bcdfb3c1f1a56991093a5782b91f444513b5a4 100644 (file)
@@ -9,7 +9,6 @@ TEMPLATE = app
 TARGET = ImageDiff
 DESTDIR = $$ROOT_BUILD_DIR/bin
 
-QT = core gui
-haveQt(5): QT += widgets
+QT = core gui widgets
 
 SOURCES = ImageDiff.cpp
index 684cfa8f70d78bea6ca1a4fa612c9591e1b92322..410ac7c35a27aa3d6f7563c780986e7c02bc1ffc 100644 (file)
@@ -123,27 +123,7 @@ int main(int argc, char* argv[])
     QApplication app(argc, argv);
     app.setQuitOnLastWindowClosed(false);
 
-#if HAVE(QT5)
     QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
-#else
-#ifdef Q_WS_X11
-    QX11Info::setAppDpiY(0, 96);
-    QX11Info::setAppDpiX(0, 96);
-#endif
-
-   /*
-    * QApplication will initialize the default application font based
-    * on the application DPI at construction time, which might be
-    * different from the DPI we explicitly set using QX11Info above.
-    * See: https://bugreports.qt.nokia.com/browse/QTBUG-21603
-    *
-    * To ensure that the application font DPI matches the application
-    * DPI, we override the application font using the font we get from
-    * a QWidget, which has already been resolved against the existing
-    * default font, but with the correct paint-device DPI.
-   */
-    QApplication::setFont(QWidget().font());
-#endif
 
     WTFInstallReportBacktraceOnCrashHook();
 
index 6c9352cbc955d6c08d27292ae272edb0af8da908..5c123f90f8a3491419f99fe4b7fd0a48e1116826 100644 (file)
@@ -42,10 +42,9 @@ WEBKIT += wtf webcore
 
 DESTDIR = $$ROOT_BUILD_DIR/bin
 
-QT += network webkit
+QT += network webkit printsupport widgets
 
 macx:QT += xml
-haveQt(5): QT += printsupport widgets
 
 contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig
 
index b8ed7d0039da14c18c31096b195755533c020ae4..ca1b846379d5e5d015b42578f7d303d7bc7256f9 100644 (file)
 
 #include "cookiejar.h"
 
-#if HAVE(QT5)
 #include <QStandardPaths>
-#else
-#include <QDesktopServices>
-#endif
 #include <QDir>
 #include <QTextStream>
 
@@ -48,11 +44,7 @@ TestBrowserCookieJar::TestBrowserCookieJar(QObject* parent)
     connect(&m_timer, SIGNAL(timeout()), this, SLOT(saveToDisk()));
 
 #ifndef QT_NO_DESKTOPSERVICES
-#if HAVE(QT5)
     QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
-#else
-    QString path = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
-#endif
 #else
     QString path = QDir::homePath() + "/.QtTestBrowser";
 #endif
index e4ae456dbc048e7003f97b802faf2ea88bd48b00..4fc90d702c44a4899525e491bf8fc374b89b82a8 100644 (file)
 #endif
 
 #if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES)
-#if HAVE(QT5)
 #include <QStandardPaths>
-#else
-#include <QDesktopServices>
-#endif
 #include <QtNetwork/QNetworkDiskCache>
 #endif
 
@@ -808,11 +804,7 @@ void LauncherWindow::setDiskCache(bool enable)
     QNetworkDiskCache* cache = 0;
     if (enable) {
         cache = new QNetworkDiskCache();
-#if HAVE(QT5)
         QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
-#else
-        QString cacheLocation = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
-#endif
         cache->setCacheDirectory(cacheLocation);
     }
     page()->networkAccessManager()->setCache(cache);
index 641da9f2c97e40cb1362bbecf31c9c99f7552ff7..5057f5740f59ad427747e85abdb76c1de53a6510 100644 (file)
@@ -5,7 +5,7 @@
 # See 'Tools/qmake/README' for an overview of the build system
 # -------------------------------------------------------------------
 
-haveQt(5):!quick_check {
+!quick_check {
     load(configure)
     QMAKE_CONFIG_TESTS_DIR = $$PWD/config.tests
 
index 78a0a82b4d8b16181d8e2e6d1c5444261ed67398..d88884f69ef2c88393097e96242654ac825d272b 100644 (file)
@@ -19,8 +19,6 @@ isEmpty(OBJECTS_DIR): OBJECTS_DIR = obj/$$activeBuildConfig()
 DEFINES += \
     BUILDING_QT__=1
 
-haveQt(5): DEFINES += HAVE_QT5=1
-
 CONFIG(release, debug|release): DEFINES *= NDEBUG
 
 CONFIG += depend_includepath
@@ -148,11 +146,6 @@ contains(TEMPLATE, lib) {
 }
 
 contains(QT, webkit) {
-    haveQt(4) {
-        # Qt 4 still uses custom rules to depend on QtWebKit
-        load(qtwebkit)
-    }
-
     # In addition to the main shared QtWebKit library we also
     # need to link to any intermediate shared libraries.
     force_static_libs_as_shared {
@@ -238,43 +231,6 @@ for(subdir, SUBDIRS) {
     }
 }
 
-# Doing '$(MAKE) qmake' should recurse through all subdirs. In Qt5, this is
-# automatic (for 'qmake_all', while 'qmake' does not enter subdirs at all).
-haveQt(4):contains(TEMPLATE, subdirs):!no_recursive_qmake {
-    recursive_qmake.target = qmake_all
-
-    # We could do this using CONFIG += recurse but that adds
-    # a dependency for each recursive target on its makefile,
-    # while we want it to depend on *-qmake_all, so that we
-    # don't end up running qmake twice.
-
-    for(subdir, SUBDIRS) {
-        contains(NO_RECURSIVE_QMAKE_SUBDIRS, $${subdir}) {
-            debug(1, Skipping recursive qmake for $${subdir})
-            next()
-        }
-
-        subdir_config = $$eval($${subdir}.CONFIG)
-        contains(subdir_config, no_default_target):next()
-
-        debug(1, "Making qmake recursive for $$subdir")
-
-        variables = $$computeSubdirVariables($${subdir})
-
-        target_name = $$eval($${variables}.target)-recursive_qmake
-
-        eval($${target_name}.target = $$target_name)
-        eval($${target_name}.depends = $$eval($${variables}.target)-qmake_all)
-        commands = $$eval($${variables}.subdir_command) $(MAKE) -f $$eval($${variables}.makefile) qmake
-        eval($${target_name}.commands = $$commands)
-
-        QMAKE_EXTRA_TARGETS += $${target_name}
-        recursive_qmake.depends += $${target_name}
-    }
-
-    !isEmpty(recursive_qmake.depends): QMAKE_EXTRA_TARGETS += recursive_qmake
-}
-
 incremental.target = incremental
 incremental.commands = $(MAKE) -f $(MAKEFILE) qmake_all && $(MAKE) -f $(MAKEFILE)
 QMAKE_EXTRA_TARGETS += incremental
@@ -312,9 +268,4 @@ for(target, $$list($$unique(DEFAULT_TARGETS))) {
 # relative.
 DESTDIR = $$replace(DESTDIR, ^$${ROOT_BUILD_DIR}, $${BUILD_ROOT_RELATIVE_TO_OUT_PWD})
 
-# Since we loaded our own rules for depending on QtWebKit, and we
-# have no more logic that checks contains(QT, webkit), we unset it
-# here so that Qt will not add its own include and library paths.
-haveQt(4): QT -= webkit webkit-private
-
 load(default_post) # Load Qt's defaults
index 4a50ba22464936845287c42f0ad84062de11ceab..c91aab9b32ebcd88bf6ad5eca8faa3d87e3e0889 100644 (file)
@@ -56,12 +56,6 @@ win32* {
     isEmpty(pwd_starts_with_slash): CONFIG += win_cmd_shell
 }
 
-haveQt(4) {
-    # Make sure QMAKEPATH is set for recursive targets
-    win_cmd_shell: QMAKE_QMAKE = \(set QMAKEPATH=$$(QMAKEPATH)\) && $$QMAKE_QMAKE
-    else: QMAKE_QMAKE = QMAKEPATH=$$(QMAKEPATH) $$QMAKE_QMAKE
-}
-
 # Default location of generated sources
 GENERATED_SOURCES_DESTDIR = generated
 
@@ -82,42 +76,24 @@ win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL
 scratchbox: PYTHON = python2.6
 else: PYTHON = python
 
-!haveQt(4, 8):!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 4.8 is not supported.")
-
-!haveQt(5):!no_webkit2 {
-    root_project_file {
-        message("Building WebKit2 with Qt versions older than 5.0 is not supported. Disabling WebKit2.")
-        message("Read http://www.mail-archive.com/webkit-qt@lists.webkit.org/msg01674.html for more information.")
-    }
-    CONFIG += no_webkit2
-}
+!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.")
 
-haveQt(5): {
-    !haveQtModule(widgets)|!haveQtModule(printsupport) {
-        root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
-        CONFIG += no_webkit1
-    }
+!haveQtModule(widgets)|!haveQtModule(printsupport) {
+    root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
+    CONFIG += no_webkit1
 }
 
 # We use private_tests to detect developer build, since the destdir will
 # always be our webkit build dir. This might change as configure changes.
 contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
 
-haveQt(4) {
-    # Qt5 will automatically load the module files for us, but for Qt4
-    # we have to do it manually so that the various QT.webkit.foo names
-    # are available.
-    include($${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri)
-}
-
 # Set some defaults for specific platforms
 CONFIG += include_webinspector
 
 # Try to locate sqlite3 source (for WebCore)
 SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
 isEmpty(SQLITE3SRCDIR) {
-    haveQt(5): SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
-    else: SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
+    SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
 }
 
 # --------- Make features available to JSC ------------
index 4a6443427041a29baade80f1b9e88d97b0e2ab2e..117cc434a066b99cc1e35e43b1853e2a6f6c220f 100644 (file)
@@ -31,30 +31,17 @@ load(mobilityconfig, true)
 # by having the feature disabled in features.pri. Nor do you have to
 # unset the opposite value, that's handled automatically for you.
 
-# For Mac we do not rely on QT_CONFIG, because icu is not officially supported for all of qt.
-haveQt(5):if(contains(QT_CONFIG,icu)|mac) {
-    DEFINES += WTF_USE_ICU_UNICODE=1
-    DEFINES -= WTF_USE_QT4_UNICODE=1
-} else {
-    DEFINES += WTF_USE_QT4_UNICODE=1
-    DEFINES -= WTF_USE_ICU_UNICODE=1
-}
+DEFINES += WTF_USE_ICU_UNICODE=1
+DEFINES -= WTF_USE_QT4_UNICODE=1
 
 !contains(DEFINES, HAVE_QRAWFONT=.) {
     # Use of QRawFont in Qt 5:
-    haveQt(5): DEFINES += HAVE_QRAWFONT=1
+    DEFINES += HAVE_QRAWFONT=1
 }
 
 # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
-haveQt(5) {
-    config_fontconfig:!mac {
-        DEFINES += HAVE_FONTCONFIG=1
-    }
-} else {
-    # Qt 4
-    unix:!mac:!embedded {
-        DEFINES += HAVE_FONTCONFIG=1
-    }
+config_fontconfig:!mac {
+    DEFINES += HAVE_FONTCONFIG=1
 }
 
 # We need libxml2 config test to determine to use libxml2 or not
@@ -80,7 +67,7 @@ haveQt(5) {
 
 # Nescape plugins support (NPAPI)
 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
-    haveQt(5):xlibAvailable() {
+    xlibAvailable() {
         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
         CONFIG += plugin_backend_xlib
     } else: unix|win32-*:!embedded:!wince* {
@@ -105,7 +92,7 @@ haveQt(5) {
 }
 
 # QStyle detection
-haveQt(4)|haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
+haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
 
 # WebGL support
 !contains(DEFINES, ENABLE_WEBGL=.) {
@@ -134,17 +121,9 @@ haveQt(4)|haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
 }
 
 # orientation support
-haveQt(5) {
-    haveQtModule(sensors) {
-        !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
-        !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
-    }
-} else {
-    # Qt 4 with Qt Mobility
-    contains(MOBILITY_CONFIG, sensors) {
-        !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
-        !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
-    }
+haveQtModule(sensors) {
+    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
+    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
 }
 
 # HTML5 Media Support
@@ -169,15 +148,8 @@ haveQt(5) {
     !no_webkit2: DEFINES += ENABLE_FULLSCREEN_API=1
 }
 
-haveQt(4) {
-    haveQtModule(declarative): DEFINES += HAVE_QQUICK1=1
-} else {
-    # FIXME: Add Qt 5 QQuick1 support once QDeclarativeEngine in QQuick2
-    # is called QmlEngine and it is safe for us to use QQuick1 again.
-}
-
 # Xcomposite Support
-haveQt(5):linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1
+linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1
 
 # Xrender Support
 haveQt(5):linux-*:config_libXrender: DEFINES += HAVE_XRENDER=1
@@ -187,11 +159,9 @@ haveQt(5):linux-*:config_glx: DEFINES += HAVE_GLX=1
 
 # Support for Graphics Surface
 !contains(DEFINES, WTF_USE_GRAPHICS_SURFACE=.) {
-    haveQt(5) {
-        mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1
-        # On linux we require GLX, libXcomposite and libXrender to enable graphics surface.
-        linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1
-    }
+    mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1
+    # On linux we require GLX, libXcomposite and libXrender to enable graphics surface.
+    linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1
 }
 
 # -------------- Fill in static defaults --------------
@@ -237,13 +207,10 @@ for(define, DEFINES) {
 !contains(DEFINES, WTF_USE_3D_GRAPHICS=.) {
     # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details.
     !win32-* {
-        haveQt(5)|contains(QT_CONFIG, opengl): DEFINES += WTF_USE_3D_GRAPHICS=1
+        DEFINES += WTF_USE_3D_GRAPHICS=1
     }
 }
 
-haveQt(4):contains(DEFINES, ENABLE_WEBGL=1):contains(DEFINES, WTF_USE_3D_GRAPHICS=0) {
-    error("WebGL requires Qt to be configured with OpenGL. Please reconfigure Qt with OpenGL, or build WebKit without WebGL.")
-}
 
 # Slider Touch is sensible to use when compiling WebKit2
 haveQt(5):contains(DEFINES, ENABLE_TOUCH_EVENTS=1) {
index a086e769bba66939829c86afa46dd56bec5593bd..972a2079f287e1bdd66067120a065850ddc59e6c 100644 (file)
@@ -137,51 +137,16 @@ defineTest(addStrictSubdirOrderBetween) {
     first_base_target = sub-$$replace(firstSubdirFile, [^a-zA-Z0-9_], -)
     second_base_target = sub-$$replace(secondSubdirFile, [^a-zA-Z0-9_], -)
 
-    haveQt(4) {
-        # Use a custom target for making the derived sources instead of the default ones,
-        # as the default ones depend on $(MAKEFILE), while we want to depend on *qmake_all.
-        # Without this rule we end up running qmake twice for the derived sources, as well as
-        # introducing a race condition where we run "qmake -o Makefile.DerivedSources" at the
-        # same time as we run "make -f Makefile.DerivedSources", resulting in make reading a
-        # half-written makefile.
-        derived_make_for_qmake.target = $${first_base_target}-make_for_qmake
-        derived_make_for_qmake.depends = $${first_base_target}-qmake_all
-        derived_make_for_qmake.commands = $(MAKE) -f $$eval($${firstSubdir}.makefile)
-        QMAKE_EXTRA_TARGETS += derived_make_for_qmake
-
-        # This target ensures that running "make qmake" will force both qmake and make
-        # to be run on the derived sources before running qmake on the target, so that
-        # qmake can pick up the right dependencies for the target based on the derived
-        # sources that were generated.
-        target_make_qmake.target = $${second_base_target}-qmake_all
-        target_make_qmake.depends = $${derived_make_for_qmake.target}
-        QMAKE_EXTRA_TARGETS += target_make_qmake
-
-        GNUmake {
-            # This target ensures that running make before any makefiles have been created
-            # will still force qmake and make to be run on the derived sources first.
-            target_make.target = $$eval($${secondSubdir}.makefile)
-
-            # We use order-only-prerequisites so that we can run make on the derived sources
-            # without triggering a qmake run on the target due to updated dependencies.
-            target_make.depends = "| $${first_base_target}-make_default-ordered"
-
-            QMAKE_EXTRA_TARGETS += target_make
-        }
-    } else {
-        # Qt5's qmake does most of the above for us already.
-
-        # This target ensures that running "make qmake_all" will force both qmake and make
-        # to be run on the derived sources before running qmake on the target, so that
-        # qmake can pick up the right dependencies for the target based on the derived
-        # sources that were generated. Just "make qmake" is non-recursive anyway.
-        target_make_qmake.target = $${second_base_target}-qmake_all
-        target_make_qmake.depends = $${first_base_target}
-        QMAKE_EXTRA_TARGETS += target_make_qmake
-
-        # Make things work even if qmake -r is used.
-        CONFIG += dont_recurse
-    }
+    # This target ensures that running "make qmake_all" will force both qmake and make
+    # to be run on the derived sources before running qmake on the target, so that
+    # qmake can pick up the right dependencies for the target based on the derived
+    # sources that were generated. Just "make qmake" is non-recursive anyway.
+    target_make_qmake.target = $${second_base_target}-qmake_all
+    target_make_qmake.depends = $${first_base_target}
+    QMAKE_EXTRA_TARGETS += target_make_qmake
+
+    # Make things work even if qmake -r is used.
+    CONFIG += dont_recurse
 
     export(SUBDIRS)
     export(NO_RECURSIVE_QMAKE_SUBDIRS)
@@ -223,7 +188,6 @@ defineTest(haveQtModule) {
     unset(module)
     module = $$1
 
-    haveQt(4):contains(QT_CONFIG, $${module}): return(true)
     haveQt(5):!isEmpty(QT.$${module}.name): return(true)
     return(false)
 }
@@ -310,48 +274,10 @@ defineTest(linkAgainstLibrary) {
     return(true)
 }
 
-defineTest(runSyncQt) {
-
-    build_pass:return(true)
-
-    haveQt(5) {
-        # Qt 5 will run synqt as part of defaults_pre, so no need to do anything
-    } else {
-        # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
-        syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
-        command = $$syncqt
-        win32-msvc*: command = $$command -windows
-
-        outdir = $$toSystemPath($${ROOT_BUILD_DIR})
-
-        # The module root has to be the same as directory of the pro-file that generates
-        # the install rules (api.pri), otherwise the relative paths in the generated
-        # headers.pri will be incorrect.
-        module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
-
-        module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
-        command = perl $${command} -outdir $${outdir} -separate-module $${module}
-        message(Running $$command)
-        !system($$command) {
-            error(Failed to run $${command})
-        }
-    }
-
-    return(true)
-}
-
 defineTest(xlibAvailable) {
-    haveQt(5) {
-        contains(QT_CONFIG, xcb-xlib) {
-            return(true)
-        } else {
-            return(false)
-        }
+    contains(QT_CONFIG, xcb-xlib) {
+        return(true)
     } else {
-        unix:!mac:!embedded {
-            return(true)
-        } else {
-            return(false)
-        }
+        return(false)
     }
 }
diff --git a/Tools/qmake/mkspecs/features/qtwebkit.prf b/Tools/qmake/mkspecs/features/qtwebkit.prf
deleted file mode 100644 (file)
index 60e0b8b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# -------------------------------------------------------------------
-# This file is used by tools that rely on the QtWebKit library
-#
-# It is only used for Qt4, which does not have a module system.
-#
-# See 'Tools/qmake/README' for an overview of the build system
-# -------------------------------------------------------------------
-
-haveQt(4) {
-    QMAKE_LIBDIR = $$ROOT_BUILD_DIR/lib $$QMAKE_LIBDIR
-    QTWEBKITLIBNAME = QtWebKit
-    mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
-        LIBS += -framework $$QTWEBKITLIBNAME
-        QMAKE_FRAMEWORKPATH = $$ROOT_BUILD_DIR/lib $$QMAKE_FRAMEWORKPATH
-    } else {
-        build_pass: win32-*|wince* {
-            !CONFIG(release, debug|release): QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
-            QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
-            win32-g++*: LIBS += -l$$QTWEBKITLIBNAME
-            else: LIBS += $${QTWEBKITLIBNAME}.lib
-        } else {
-            LIBS += -lQtWebKit
-        }
-    }
-
-    DEPENDPATH += $$ROOT_WEBKIT_DIR/Source/WebKit/qt/Api
-    INCLUDEPATH += $${ROOT_BUILD_DIR}/include/QtWebKit
-} else {
-    error(Relying on $$_FILE_ for Qt5 builds are not supported)
-}
index c23713520b48fa9fd7ac1e1503318a4649e89953..83b7cc4a9df3c16c600955cd8c5dd6fa6f03ee5a 100644 (file)
@@ -6,7 +6,7 @@
 
 load(functions)
 
-haveQt(5): CONFIG += object_parallel_to_source
+CONFIG += object_parallel_to_source
 
 # Expose if we are building inside Scratchbox
 SBOX_CHECK = $$(_SBOX_DIR)
index 83e469831fb89f02e848fba0cc273ffe299cfaed..f43dcac9e2a79a664eed26202ddfb9529c472780 100644 (file)
@@ -5,14 +5,7 @@
 # See 'Tools/qmake/README' for an overview of the build system
 # -------------------------------------------------------------------
 
-haveQt(4) {
-    QMAKEPATH = $$(QMAKEPATH)
-    isEmpty(QMAKEPATH)|!exists($${QMAKEPATH}/mkspecs) {
-        error("The environment variable QMAKEPATH needs to point to $WEBKITSRC/Tools/qmake")
-        # Otherwise we won't pick up the feature prf files needed for the build
-    }
-} else:!webkit_configured {
-    CONFIG += webkit_configured
+!webkit_configured {
     CONFIG += production_build
     include(Tools/qmake/configure.pri)
     the_config = $$CONFIG