[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 13:51:43 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e76a526a9f4aad1cf6a316ff42ab759aedf0cc9d
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 28 15:09:42 2010 +0000
2010-09-28 Benjamin Poulain <benjamin.poulain at nokia.com>
Reviewed by Andreas Kling.
[Qt] Remove support for Qt 4.5
https://bugs.webkit.org/show_bug.cgi?id=46718
Remove the code for versions of Qt prior to 4.6.
* Api/qgraphicswebview.cpp:
(QGraphicsWebViewPrivate::updateResizesToContentsForPage):
(QGraphicsWebView::QGraphicsWebView):
(QGraphicsWebView::sceneEvent):
(QGraphicsWebViewPrivate::detachCurrentPage):
* Api/qwebframe.cpp:
(QWebFrame::load):
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::handleSoftwareInputPanel):
(QWebPagePrivate::inputMethodEvent):
(QWebPagePrivate::touchEvent):
(QWebPage::inputMethodQuery):
(QWebPage::view):
(QWebPage::event):
* Api/qwebpage_p.h:
* Api/qwebview.cpp:
(QWebView::QWebView):
(QWebViewPrivate::detachCurrentPage):
(QWebView::event):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::setInputMethodState):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::createPlugin):
* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQWidget::setInputMethodHints):
(WebCore::PageClientQGraphicsWidget::setInputMethodEnabled):
(WebCore::PageClientQGraphicsWidget::inputMethodEnabled):
(WebCore::PageClientQGraphicsWidget::setInputMethodHints):
* WebCoreSupport/PageClientQt.h:
(WebCore::QGraphicsItemOverlay::page):
* tests/qwebframe/tst_qwebframe.cpp:
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::inputMethods_data):
(inputMethodHints):
(inputMethodEnabled):
(tst_QWebPage::inputMethods):
(tst_QWebPage::originatingObjectInNetworkRequests):
* tests/qwebview/tst_qwebview.cpp:
(tst_QWebView::reusePage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 3836e34..36d4326 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -130,13 +130,8 @@ void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
if (!page->preferredContentsSize().isValid())
page->setPreferredContentsSize(QSize(960, 800));
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
q, SLOT(_q_contentsSizeChanged(const QSize&)), Qt::UniqueConnection);
-#else
- QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
- q, SLOT(_q_contentsSizeChanged(const QSize&)));
-#endif
} else {
QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
q, SLOT(_q_contentsSizeChanged(const QSize&)));
@@ -242,14 +237,10 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
: QGraphicsWidget(parent)
, d(new QGraphicsWebViewPrivate(this))
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-#endif
setAcceptDrops(true);
setAcceptHoverEvents(true);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setAcceptTouchEvents(true);
-#endif
setFocusPolicy(Qt::StrongFocus);
setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
#if ENABLE(TILED_BACKING_STORE)
@@ -315,7 +306,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
{
// Re-implemented in order to allows fixing event-related bugs in patch releases.
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (d->page && (event->type() == QEvent::TouchBegin
|| event->type() == QEvent::TouchEnd
|| event->type() == QEvent::TouchUpdate)) {
@@ -324,7 +314,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
// Always return true so that we'll receive also TouchUpdate and TouchEnd events
return true;
}
-#endif
return QGraphicsWidget::sceneEvent(event);
}
@@ -418,11 +407,7 @@ void QGraphicsWebViewPrivate::detachCurrentPage()
if (!page)
return;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
page->d->view.clear();
-#else
- page->d->view = 0;
-#endif
// The client has always to be deleted.
delete page->d->client;
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 7295b82..1791096 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -789,11 +789,9 @@ void QWebFrame::load(const QNetworkRequest &req,
case QNetworkAccessManager::PostOperation:
request.setHTTPMethod("POST");
break;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QNetworkAccessManager::DeleteOperation:
request.setHTTPMethod("DELETE");
break;
-#endif
case QNetworkAccessManager::UnknownOperation:
// eh?
break;
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index b857bc0..51e3dc3 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -88,6 +88,7 @@
#include "GeolocationPermissionClientQt.h"
#include "NotificationPresenterClientQt.h"
#include "PageClientQt.h"
+#include "PlatformTouchEvent.h"
#include "WorkerThread.h"
#include "wtf/Threading.h"
@@ -115,16 +116,13 @@
#include <QSysInfo>
#include <QTextCharFormat>
#include <QTextDocument>
+#include <QTouchEvent>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-#include <QTouchEvent>
-#include "PlatformTouchEvent.h"
-#endif
using namespace WebCore;
@@ -263,9 +261,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
#ifndef QT_NO_UNDOSTACK
, undoStack(0)
#endif
-#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0)
- , view(0)
-#endif
, insideOpenCall(false)
, m_totalBytes(0)
, m_bytesReceived()
@@ -799,7 +794,6 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Frame* frame = page->focusController()->focusedFrame();
if (!frame)
return;
@@ -816,7 +810,6 @@ void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
}
clickCausedFocus = false;
-#endif
}
void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
@@ -1142,9 +1135,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
{
WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
WebCore::Editor *editor = frame->editor();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant());
-#endif
if (!editor->canEdit()) {
ev->ignore();
@@ -1183,13 +1174,11 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
}
break;
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QInputMethodEvent::Selection: {
selection = a;
hasSelection = true;
break;
}
-#endif
}
}
@@ -1201,7 +1190,6 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
// 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text
// 4. otherwise event is updating supplied pre-edit text
QString preedit = ev->preeditString();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (hasSelection) {
QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
if (preedit.isEmpty() && selection.start + selection.length > 0)
@@ -1209,10 +1197,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
editor->setComposition(preedit, underlines,
(selection.length < 0) ? selection.start + selection.length : selection.start,
(selection.length < 0) ? selection.start : selection.start + selection.length);
- } else
-#endif
- if (!preedit.isEmpty())
- editor->setComposition(preedit, underlines, preedit.length(), 0);
+ } else if (!preedit.isEmpty())
+ editor->setComposition(preedit, underlines, preedit.length(), 0);
}
ev->accept();
@@ -1401,7 +1387,6 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
return frame->eventHandler()->scrollRecursively(direction, granularity);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
bool QWebPagePrivate::touchEvent(QTouchEvent* event)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -1414,7 +1399,6 @@ bool QWebPagePrivate::touchEvent(QTouchEvent* event)
// Return whether the default action was cancelled in the JS event handler
return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
}
-#endif
/*!
This method is used by the input method to query a set of properties of the page
@@ -1489,7 +1473,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
return QVariant();
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case Qt::ImAnchorPosition: {
if (renderTextControl) {
if (editor->hasComposition()) {
@@ -1512,7 +1495,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
}
return QVariant(0);
}
-#endif
default:
return QVariant();
}
@@ -2005,11 +1987,7 @@ void QWebPage::setView(QWidget* view)
*/
QWidget *QWebPage::view() const
{
-#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0)
- return d->view;
-#else
return d->view.data();
-#endif
}
/*!
@@ -2920,13 +2898,11 @@ bool QWebPage::event(QEvent *ev)
case QEvent::Leave:
d->leaveEvent(ev);
break;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
// Return whether the default action was cancelled in the JS event handler
return d->touchEvent(static_cast<QTouchEvent*>(ev));
-#endif
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange:
d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev));
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index e517f7e..12716f9 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -131,10 +131,8 @@ public:
void handleSoftwareInputPanel(Qt::MouseButton);
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// Returns whether the default action was cancelled in the JS event handler
bool touchEvent(QTouchEvent*);
-#endif
void setInspector(QWebInspector*);
QWebInspector* getOrCreateInspector();
@@ -155,11 +153,7 @@ public:
QUndoStack *undoStack;
#endif
-#if QT_VERSION >= 0x040600
QWeakPointer<QWidget> view;
-#else
- QWidget* view;
-#endif
bool insideOpenCall;
quint64 m_totalBytes;
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 1f400cb..64b7a90 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -307,9 +307,7 @@ QWebView::QWebView(QWidget *parent)
setAttribute(Qt::WA_InputMethodEnabled);
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setAttribute(Qt::WA_AcceptTouchEvents);
-#endif
#if defined(Q_WS_MAEMO_5)
QAbstractKineticScroller* scroller = new QWebViewKineticScroller();
static_cast<QWebViewKineticScroller*>(scroller)->setWidget(this);
@@ -348,13 +346,7 @@ void QWebViewPrivate::detachCurrentPage()
if (!page)
return;
- if (page) {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- page->d->view.clear();
-#else
- page->d->view = 0;
-#endif
- }
+ page->d->view.clear();
// if the page client is the special client constructed for
// delegating the responsibilities to a QWidget, we need
@@ -828,7 +820,6 @@ bool QWebView::event(QEvent *e)
if (cursor().shape() == Qt::ArrowCursor)
d->page->d->client->resetCursor();
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
} else if (e->type() == QEvent::TouchBegin
|| e->type() == QEvent::TouchEnd
|| e->type() == QEvent::TouchUpdate) {
@@ -836,7 +827,6 @@ bool QWebView::event(QEvent *e)
// Always return true so that we'll receive also TouchUpdate and TouchEnd events
return true;
-#endif
} else if (e->type() == QEvent::Leave)
d->page->event(e);
}
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index b79ad0d..18f7c4f 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,53 @@
+2010-09-28 Benjamin Poulain <benjamin.poulain at nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove support for Qt 4.5
+ https://bugs.webkit.org/show_bug.cgi?id=46718
+
+ Remove the code for versions of Qt prior to 4.6.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::updateResizesToContentsForPage):
+ (QGraphicsWebView::QGraphicsWebView):
+ (QGraphicsWebView::sceneEvent):
+ (QGraphicsWebViewPrivate::detachCurrentPage):
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::handleSoftwareInputPanel):
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPagePrivate::touchEvent):
+ (QWebPage::inputMethodQuery):
+ (QWebPage::view):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebViewPrivate::detachCurrentPage):
+ (QWebView::event):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQWidget::setInputMethodHints):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::inputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodHints):
+ * WebCoreSupport/PageClientQt.h:
+ (WebCore::QGraphicsItemOverlay::page):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods_data):
+ (inputMethodHints):
+ (inputMethodEnabled):
+ (tst_QWebPage::inputMethods):
+ (tst_QWebPage::originatingObjectInNetworkRequests):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage):
+
2010-09-28 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
Reviewed by Simon Hausmann.
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 080c459..9db4333 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -595,7 +595,6 @@ void EditorClientQt::setInputMethodState(bool active)
{
QWebPageClient* webPageClient = m_page->d->client;
if (webPageClient) {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Qt::InputMethodHints hints;
HTMLInputElement* inputElement = 0;
@@ -628,8 +627,7 @@ void EditorClientQt::setInputMethodState(bool active)
hints |= Qt::ImhNoAutoUppercase;
hints |= Qt::ImhNoPredictiveText;
#endif // Q_WS_MAEMO_5 || Q_WS_MAEMO_6 || Q_OS_SYMBIAN
- webPageClient->setInputMethodHints(hints);
-#endif // QT_VERSION check
+ webPageClient->setInputMethodHints(hints);
webPageClient->setInputMethodEnabled(active);
}
emit m_page->microFocusChanged();
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 94ecc4e..3b8d860 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1367,7 +1367,6 @@ private:
}
};
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
class QtPluginGraphicsWidget: public Widget
{
public:
@@ -1412,7 +1411,6 @@ private:
QGraphicsWidget* graphicsWidget;
};
-#endif
PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames,
const Vector<String>& paramValues, const String& mimeType, bool loadManually)
@@ -1485,7 +1483,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
w->setFrameRect(IntRect(0, 0, 0, 0));
return w;
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+
QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
if (graphicsWidget) {
QGraphicsObject* parentWidget = 0;
@@ -1499,7 +1497,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
w->setFrameRect(IntRect(0, 0, 0, 0));
return w;
}
-#endif
+
// FIXME: make things work for widgetless plugins as well
delete object;
}
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 83f0f48..ea209d9 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -48,12 +48,10 @@ bool PageClientQWidget::inputMethodEnabled() const
return view->testAttribute(Qt::WA_InputMethodEnabled);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
view->setInputMethodHints(hints);
}
-#endif
#ifndef QT_NO_CURSOR
QCursor PageClientQWidget::cursor() const
@@ -215,26 +213,18 @@ void PageClientQGraphicsWidget::updateTiledBackingStoreScale()
void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
-#endif
}
bool PageClientQGraphicsWidget::inputMethodEnabled() const
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
return view->flags() & QGraphicsItem::ItemAcceptsInputMethod;
-#else
- return false;
-#endif
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
view->setInputMethodHints(hints);
}
-#endif
#ifndef QT_NO_CURSOR
QCursor PageClientQGraphicsWidget::cursor() const
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 65ee849..eea7f40 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -58,9 +58,7 @@ public:
virtual void update(const QRect& dirtyRect);
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
virtual void setInputMethodHints(Qt::InputMethodHints hints);
-#endif
#ifndef QT_NO_CURSOR
virtual QCursor cursor() const;
@@ -93,9 +91,7 @@ class QGraphicsItemOverlay : public QGraphicsItem {
, page(p)
{
setPos(0, 0);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-#endif
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
}
@@ -146,9 +142,7 @@ public:
virtual void update(const QRect& dirtyRect);
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
virtual void setInputMethodHints(Qt::InputMethodHints hints);
-#endif
#ifndef QT_NO_CURSOR
virtual QCursor cursor() const;
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 48b5deb..ec8a39e 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -2947,12 +2947,7 @@ void tst_QWebFrame::evaluateWillCauseRepaint()
view.setHtml(html);
view.show();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(&view);
-#else
- QTest::qWait(2000);
-#endif
-
view.page()->mainFrame()->evaluateJavaScript(
"document.getElementById('junk').style.display = 'none';");
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index b8d4aba..36fa050 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1368,12 +1368,9 @@ void tst_QWebPage::inputMethods_data()
{
QTest::addColumn<QString>("viewType");
QTest::newRow("QWebView") << "QWebView";
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
-#endif
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
static Qt::InputMethodHints inputMethodHints(QObject* object)
{
if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
@@ -1382,14 +1379,11 @@ static Qt::InputMethodHints inputMethodHints(QObject* object)
return w->inputMethodHints();
return Qt::InputMethodHints();
}
-#endif
static bool inputMethodEnabled(QObject* object)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
return o->flags() & QGraphicsItem::ItemAcceptsInputMethod;
-#endif
if (QWidget* w = qobject_cast<QWidget*>(object))
return w->testAttribute(Qt::WA_InputMethodEnabled);
return false;
@@ -1406,9 +1400,7 @@ void tst_QWebPage::inputMethods()
wv->setPage(page);
view = wv;
container = view;
- }
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- else if (viewType == "QGraphicsWebView") {
+ } else if (viewType == "QGraphicsWebView") {
QGraphicsWebView* wv = new QGraphicsWebView;
wv->setPage(page);
view = wv;
@@ -1420,9 +1412,7 @@ void tst_QWebPage::inputMethods()
wv->setGeometry(QRect(0, 0, 500, 500));
container = gv;
- }
-#endif
- else
+ } else
QVERIFY2(false, "Unknown view type");
page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont");
@@ -1441,7 +1431,6 @@ void tst_QWebPage::inputMethods()
QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
page->event(&evrel);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// This part of the test checks if the SIP (Software Input Panel) is triggered,
// which normally happens on mobile platforms, when a user input form receives
// a mouse click.
@@ -1463,15 +1452,11 @@ void tst_QWebPage::inputMethods()
QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
else
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
viewEventSpy.clear();
page->event(&evpres);
page->event(&evrel);
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
//ImMicroFocus
QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus);
@@ -1499,7 +1484,6 @@ void tst_QWebPage::inputMethods()
page->event(&eventText);
}
-#if QT_VERSION >= 0x040600
//ImMaximumTextLength
variant = page->inputMethodQuery(Qt::ImMaximumTextLength);
QCOMPARE(20, variant.toInt());
@@ -1548,14 +1532,12 @@ void tst_QWebPage::inputMethods()
variant = page->inputMethodQuery(Qt::ImCurrentSelection);
selectionValue = variant.value<QString>();
QCOMPARE(selectionValue, QString("tWebK"));
-#endif
//ImSurroundingText
variant = page->inputMethodQuery(Qt::ImSurroundingText);
QString value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
-#if QT_VERSION >= 0x040600
{
QList<QInputMethodEvent::Attribute> attributes;
// Clear the selection, so the next test does not clear any contents.
@@ -1569,7 +1551,6 @@ void tst_QWebPage::inputMethods()
variant = page->inputMethodQuery(Qt::ImSurroundingText);
value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
-#endif
// Cancel current composition first
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
@@ -1670,13 +1651,11 @@ void tst_QWebPage::inputMethods()
page->event(&evrelPassword);
QVERIFY(inputMethodEnabled(view));
-#if QT_VERSION >= 0x040600
QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText);
page->event(&evpres);
page->event(&evrel);
QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText));
-#endif
page->mainFrame()->setHtml("<html><body><p>nothing to input here");
viewEventSpy.clear();
@@ -1689,11 +1668,8 @@ void tst_QWebPage::inputMethods()
page->event(&evrel);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
-#if QT_VERSION >= 0x040600
//START - Test for sending empty QInputMethodEvent
page->mainFrame()->setHtml("<html><body>" \
"<input type='text' id='input3' value='QtWebKit2'/>" \
@@ -1707,7 +1683,6 @@ void tst_QWebPage::inputMethods()
QString inputValue = page->mainFrame()->evaluateJavaScript("document.getElementById('input3').value").toString();
QCOMPARE(inputValue, QString("QtWebKit2"));
//END - Test for sending empty QInputMethodEvent
-#endif
delete container;
}
@@ -2089,10 +2064,8 @@ void tst_QWebPage::originatingObjectInNetworkRequests()
QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames();
QCOMPARE(childFrames.count(), 2);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
for (int i = 0; i < 2; ++i)
QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i));
-#endif
}
/**
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index fd4978d..8cd2f3f 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -142,22 +142,14 @@ void tst_QWebView::reusePage()
}
view1->show();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(view1);
-#else
- QTest::qWait(2000);
-#endif
delete view1;
QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
QWebView *view2 = new QWebView;
view2->setPage(page);
view2->show(); // in Windowless mode, you should still be able to see the plugin here
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(view2);
-#else
- QTest::qWait(2000);
-#endif
delete view2;
delete page; // must not crash
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list