[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:29:42 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d1dd81566e3e0915d407687b2d1c292eedb64f88
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 27 10:55:56 2010 +0000

    [Qt] Incorrect input method hints
    https://bugs.webkit.org/show_bug.cgi?id=43037
    
    Reviewed by Tor Arne Vestbø.
    
    Properly set or reset all input method hints when
    activating input fields.
    
    * WebCoreSupport/EditorClientQt.cpp:
    (WebCore::EditorClientQt::setInputMethodState):
    * tests/qwebview/tst_qwebview.cpp:
    (tst_QWebView::focusInputTypes): Extended unit test to verify that we
    reset hints.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 2914174..cde5a5b 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-27  Simon Hausmann  <simon.hausmann at nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Incorrect input method hints
+        https://bugs.webkit.org/show_bug.cgi?id=43037
+
+        Properly set or reset all input method hints when
+        activating input fields.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::setInputMethodState):
+        * tests/qwebview/tst_qwebview.cpp:
+        (tst_QWebView::focusInputTypes): Extended unit test to verify that we
+        reset hints.
+
 2010-07-27  Kim Grönholm  <kim.1.gronholm at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 74c8438..54993b1 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -603,20 +603,18 @@ void EditorClientQt::setInputMethodState(bool active)
                 inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
 
         if (inputElement) {
-            if (!active) {
-                // 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.
-                active = inputElement->isPasswordField();
-                webPageClient->setInputMethodHint(Qt::ImhHiddenText, active);
-            } else {
-                // Set input method hints for "number", "tel", "email", and "url" 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());
-                webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField());
-            }
+            // 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());
+            // 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)
+                active = true;
         }
 
 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 835ad82..5dc5e41 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -267,23 +267,36 @@ void tst_QWebView::focusInputTypes()
 
     // 'password' field
     webView->fireMouseClick(QPoint(20, 60));
-    QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText);
+    QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText);
 
     // 'tel' field
     webView->fireMouseClick(QPoint(20, 110));
-    QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly);
+    QVERIFY(webView->inputMethodHints() == Qt::ImhDialableCharactersOnly);
 
     // 'number' field
     webView->fireMouseClick(QPoint(20, 160));
-    QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly);
+    QVERIFY(webView->inputMethodHints() == Qt::ImhDigitsOnly);
 
     // 'email' field
     webView->fireMouseClick(QPoint(20, 210));
-    QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly);
+    QVERIFY(webView->inputMethodHints() == Qt::ImhEmailCharactersOnly);
 
     // 'url' field
     webView->fireMouseClick(QPoint(20, 260));
-    QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly);
+    QVERIFY(webView->inputMethodHints() == Qt::ImhUrlCharactersOnly);
+
+    // 'password' field
+    webView->fireMouseClick(QPoint(20, 60));
+    QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText);
+
+    // 'text' type
+    webView->fireMouseClick(QPoint(20, 10));
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
+    QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase);
+    QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText);
+#else
+    QVERIFY(webView->inputMethodHints() == Qt::ImhNone);
+#endif
 
     delete webView;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list