[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hausmann at webkit.org
hausmann at webkit.org
Wed Dec 22 11:44:15 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1b69ced8ca985998d135ed2353967a6742ea93ad
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 5 12:40:08 2010 +0000
[Qt] Clean up the input method handling
https://bugs.webkit.org/show_bug.cgi?id=43545
Reviewed by Tor Arne Vestbø.
WebCore:
Changed input method hint interface to be more efficient by setting
all hints in one shot, like in QWidget.
* platform/qt/QWebPageClient.h:
WebKit/qt:
Replace the way of individually setting input method hints by
many calls to QWidget::setInputMethodHints with one single call.
This is more efficient by requiring less updates in the input
method hint.
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::setInputMethodState):
* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQWidget::setInputMethodHints):
(WebCore::PageClientQGraphicsWidget::setInputMethodHints):
* WebCoreSupport/PageClientQt.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c8774e6..91432f0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-05 Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Clean up the input method handling
+ https://bugs.webkit.org/show_bug.cgi?id=43545
+
+ Changed input method hint interface to be more efficient by setting
+ all hints in one shot, like in QWidget.
+
+ * platform/qt/QWebPageClient.h:
+
2010-08-05 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index 1f508bb..a0a0218 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -59,7 +59,7 @@ public:
#endif
#if QT_VERSION >= 0x040600
- virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable) = 0;
+ virtual void setInputMethodHints(Qt::InputMethodHints hint) = 0;
#endif
#ifndef QT_NO_CURSOR
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 35da328..d71e9d3 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,23 @@
+2010-08-05 Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Clean up the input method handling
+ https://bugs.webkit.org/show_bug.cgi?id=43545
+
+ Replace the way of individually setting input method hints by
+ many calls to QWidget::setInputMethodHints with one single call.
+
+ This is more efficient by requiring less updates in the input
+ method hint.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQWidget::setInputMethodHints):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodHints):
+ * WebCoreSupport/PageClientQt.h:
+
2010-08-05 David Leong <david.leong at nokia.com>
Reviewed by Simon Hausmann.
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 664d44d..2bcd3cb 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -596,12 +596,7 @@ void EditorClientQt::setInputMethodState(bool active)
QWebPageClient* webPageClient = m_page->d->client;
if (webPageClient) {
#if QT_VERSION >= 0x040600
- // Make sure to reset input method hint
- webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, false);
- webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, false);
- webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, false);
- webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, false);
- webPageClient->setInputMethodHint(Qt::ImhHiddenText, false);
+ Qt::InputMethodHints hints;
HTMLInputElement* inputElement = 0;
Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
@@ -611,24 +606,29 @@ void EditorClientQt::setInputMethodState(bool active)
if (inputElement) {
// Set input method hints for "number", "tel", "email", "url" and "password" input elements.
- webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField());
- webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField());
- webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField());
- webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField());
+ if (inputElement->isTelephoneField())
+ hints |= Qt::ImhDialableCharactersOnly;
+ if (inputElement->isNumberField())
+ hints |= Qt::ImhDigitsOnly;
+ if (inputElement->isEmailField())
+ hints |= Qt::ImhEmailCharactersOnly;
+ if (inputElement->isUrlField())
+ hints |= Qt::ImhUrlCharactersOnly;
// Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag
// for password fields. The Qt platform is responsible for determining which widget
// will receive input method events for password fields.
- bool isPasswordField = inputElement->isPasswordField();
- webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
- if (isPasswordField)
+ if (inputElement->isPasswordField()) {
active = true;
+ hints |= Qt::ImhHiddenText;
+ }
}
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
// disables auto-uppercase and predictive text for mobile devices
- webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true);
- webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true);
+ 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->setInputMethodEnabled(active);
}
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 90a5a63..5d06400 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -49,12 +49,9 @@ bool PageClientQWidget::inputMethodEnabled() const
}
#if QT_VERSION >= 0x040600
-void PageClientQWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
- if (enable)
- view->setInputMethodHints(view->inputMethodHints() | hint);
- else
- view->setInputMethodHints(view->inputMethodHints() & ~hint);
+ view->setInputMethodHints(hints);
}
#endif
@@ -233,12 +230,9 @@ bool PageClientQGraphicsWidget::inputMethodEnabled() const
}
#if QT_VERSION >= 0x040600
-void PageClientQGraphicsWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
- if (enable)
- view->setInputMethodHints(view->inputMethodHints() | hint);
- else
- view->setInputMethodHints(view->inputMethodHints() & ~hint);
+ view->setInputMethodHints(hints);
}
#endif
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 1204afc..d92306a 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -59,7 +59,7 @@ public:
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
#if QT_VERSION >= 0x040600
- virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+ virtual void setInputMethodHints(Qt::InputMethodHints hints);
#endif
#ifndef QT_NO_CURSOR
@@ -147,7 +147,7 @@ public:
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
#if QT_VERSION >= 0x040600
- virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+ virtual void setInputMethodHints(Qt::InputMethodHints hints);
#endif
#ifndef QT_NO_CURSOR
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list