[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

laszlo.1.gombos at nokia.com laszlo.1.gombos at nokia.com
Thu Oct 29 20:42:32 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 0bab38c28a74949712684ae85fdb653f69e5226e
Author: laszlo.1.gombos at nokia.com <laszlo.1.gombos at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 9 17:31:50 2009 +0000

    2009-10-09  Joe Ligman  <joseph.ligman at nokia.com>
    
            Reviewed by Simon Hausmann.
    
            Sets Qt::WA_InputMethodEnabled and Qt::ImhHiddenText for password fields in EditorClientQt
            setInputMethodState. This change is needed so widgets such as the s60 software
            input panel can receive input method events for password fields.
            It's up to the Qt platform to determine which widget will receive input method
            events when these flags are set.
            Also added implementation for setInputMethodEnabled and setInputMethodHint
            to QGraphicsWebViewPrivate and QWebViewPrivate. This change removes the direct
            dependency on QWebView and uses QWebPageClient.
            Added autotest to tst_qwebpage.cpp
    
            https://bugs.webkit.org/show_bug.cgi?id=30023
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebViewPrivate::setInputMethodEnabled):
            (QGraphicsWebViewPrivate::setInputMethodHint):
            * Api/qwebview.cpp:
            (QWebViewPrivate::setInputMethodEnabled):
            (QWebViewPrivate::setInputMethodHint):
            * WebCoreSupport/EditorClientQt.cpp:
            (WebCore::EditorClientQt::setInputMethodState):
            * tests/qwebpage/tst_qwebpage.cpp:
            (tst_QWebPage::inputMethods):
    
    2009-10-09  Joe Ligman  <joseph.ligman at nokia.com>
    
            Reviewed by Simon Hausmann.
    
            [Qt] Added pure virtual methods setInputMethodEnabled and setInputMethodHint to QWebPageClient
    
            https://bugs.webkit.org/show_bug.cgi?id=30023
    
            * platform/qt/QWebPageClient.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49397 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 245258f..c9af55a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-09  Joe Ligman  <joseph.ligman at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Added pure virtual methods setInputMethodEnabled and setInputMethodHint to QWebPageClient
+
+        https://bugs.webkit.org/show_bug.cgi?id=30023
+
+        * platform/qt/QWebPageClient.h:
+
 2009-10-08  Dave Hyatt  <hyatt at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index 09f7886..6cf0067 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -32,7 +32,10 @@ class QWebPageClient {
 public:
     virtual void scroll(int dx, int dy, const QRect&) = 0;
     virtual void update(const QRect&) = 0;
-
+    virtual void setInputMethodEnabled(bool enable) = 0;
+#if QT_VERSION >= 0x040600
+    virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable) = 0;
+#endif
     inline void resetCursor()
     {
 #ifndef QT_NO_CURSOR
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index c267745..19f693b 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -44,6 +44,10 @@ public:
 
     virtual void scroll(int dx, int dy, const QRect&);
     virtual void update(const QRect& dirtyRect);
+    virtual void setInputMethodEnabled(bool enable);
+#if QT_VERSION >= 0x040600
+    virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
 
 #ifndef QT_NO_CURSOR
     virtual QCursor cursor() const;
@@ -96,6 +100,20 @@ void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
     q->update(QRectF(dirtyRect));
 }
 
+
+void QGraphicsWebViewPrivate::setInputMethodEnabled(bool enable)
+{
+    q->setAttribute(Qt::WA_InputMethodEnabled, enable);
+}
+#if QT_VERSION >= 0x040600
+void QGraphicsWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+    if (enable)
+        q->setInputMethodHints(q->inputMethodHints() | hint);
+    else
+        q->setInputMethodHints(q->inputMethodHints() & ~hint);
+}
+#endif
 #ifndef QT_NO_CURSOR
 QCursor QGraphicsWebViewPrivate::cursor() const
 {
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index ce8b923..330463a 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -47,6 +47,10 @@ public:
 
     virtual void scroll(int dx, int dy, const QRect&);
     virtual void update(const QRect& dirtyRect);
+    virtual void setInputMethodEnabled(bool enable);
+#if QT_VERSION >= 0x040600
+    virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
 
 #ifndef QT_NO_CURSOR
     virtual QCursor cursor() const;
@@ -76,6 +80,19 @@ void QWebViewPrivate::update(const QRect & dirtyRect)
     view->update(dirtyRect);
 }
 
+void QWebViewPrivate::setInputMethodEnabled(bool enable)
+{
+    view->setAttribute(Qt::WA_InputMethodEnabled, enable);
+}
+#if QT_VERSION >= 0x040600
+void QWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+    if (enable)
+        view->setInputMethodHints(view->inputMethodHints() | hint);
+    else
+        view->setInputMethodHints(view->inputMethodHints() & ~hint);
+}
+#endif
 #ifndef QT_NO_CURSOR
 QCursor QWebViewPrivate::cursor() const
 {
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index a1e81a9..7ea8dc4 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,29 @@
+2009-10-09  Joe Ligman  <joseph.ligman at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Sets Qt::WA_InputMethodEnabled and Qt::ImhHiddenText for password fields in EditorClientQt
+        setInputMethodState. This change is needed so widgets such as the s60 software 
+        input panel can receive input method events for password fields.
+        It's up to the Qt platform to determine which widget will receive input method 
+        events when these flags are set.
+        Also added implementation for setInputMethodEnabled and setInputMethodHint 
+        to QGraphicsWebViewPrivate and QWebViewPrivate. This change removes the direct
+        dependency on QWebView and uses QWebPageClient.
+        Added autotest to tst_qwebpage.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=30023
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::setInputMethodEnabled):
+        (QGraphicsWebViewPrivate::setInputMethodHint):
+        * Api/qwebview.cpp:
+        (QWebViewPrivate::setInputMethodEnabled):
+        (QWebViewPrivate::setInputMethodHint):
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::setInputMethodState):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::inputMethods):
+
 2009-10-08  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 5d5df97..34241f0 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -41,6 +41,7 @@
 #include "FocusController.h"
 #include "Frame.h"
 #include "HTMLElement.h"
+#include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "KeyboardCodes.h"
 #include "KeyboardEvent.h"
@@ -48,6 +49,7 @@
 #include "Page.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
+#include "QWebPageClient.h"
 #include "Range.h"
 
 #include <stdio.h>
@@ -596,10 +598,26 @@ bool EditorClientQt::isEditing() const
 
 void EditorClientQt::setInputMethodState(bool active)
 {
-    QWidget *view = m_page->view();
-    if (view)
-        view->setAttribute(Qt::WA_InputMethodEnabled, active);
-
+    QWebPageClient* webPageClient = m_page->d->client;
+    if (webPageClient) {
+#if QT_VERSION >= 0x040600
+        bool isPasswordField = false;
+        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.
+            Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
+            if (frame && frame->document() && frame->document()->focusedNode()) {
+                if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) {
+                    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
+                    active = isPasswordField = inputElement->isPasswordField();
+              }
+            }
+        }
+        webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
+#endif
+        webPageClient->setInputMethodEnabled(active);
+    }
     emit m_page->microFocusChanged();
 }
 
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index a9f9f16..6fcb533 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1212,7 +1212,8 @@ void tst_QWebPage::frameAt()
 void tst_QWebPage::inputMethods()
 {
     m_view->page()->mainFrame()->setHtml("<html><body>" \
-                                            "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>" \
+                                            "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \
+                                            "<input type='password'/>" \
                                             "</body></html>");
     m_view->page()->mainFrame()->setFocus();
 
@@ -1295,6 +1296,21 @@ void tst_QWebPage::inputMethods()
     value = variant.value<QString>();
     QCOMPARE(value, QString("QtWebKit"));
 #endif
+
+    //ImhHiddenText
+    QMouseEvent evpresPassword(QEvent::MouseButtonPress, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+    m_view->page()->event(&evpresPassword);
+    QMouseEvent evrelPassword(QEvent::MouseButtonRelease, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+    m_view->page()->event(&evrelPassword);
+
+    QVERIFY(m_view->testAttribute(Qt::WA_InputMethodEnabled));
+#if QT_VERSION >= 0x040600
+    QVERIFY(m_view->inputMethodHints() & Qt::ImhHiddenText);
+
+    m_view->page()->event(&evpres);
+    m_view->page()->event(&evrel);
+    QVERIFY(!(m_view->inputMethodHints() & Qt::ImhHiddenText));
+#endif
 }
 
 // import a little DRT helper function to trigger the garbage collector

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list