[Qt] QQuickWebView does not allow for input from virtual keyboard
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2012 08:10:38 +0000 (08:10 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2012 08:10:38 +0000 (08:10 +0000)
commitb3c08b78cc8912049fa2c513ad2f8987eb475aca
tree3fc6eb46ce62485dfb8818edabba4f01f4ea3725
parentfa5dd879c52d4ca7a761d8c0433a1b4d7e2cba6f
[Qt] QQuickWebView does not allow for input from virtual keyboard
https://bugs.webkit.org/show_bug.cgi?id=85350

Reviewed by Kenneth Christiansen.

It is necessary to set the ItemAcceptsInputMethod flag on the QQuickWebView if we have editable
content, in order for the input method to recognize that we can handle input method events.

Analyzed by Michael BrĂ¼ning.

* UIProcess/API/qt/qquickwebview.cpp: Add simple hook for executing JS as private C++ API.
(JSCallbackClosure):
(javaScriptCallback):
(QQuickWebView::runJavaScriptInMainFrame):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/tests/html/inputmethod.html: Added.
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView):
(tst_QQuickWebView::runJavaScript): Simple helper for running JS.
(tst_QQuickWebView::inputMethod): Added simple test for ItemAcceptsInputMethod toggling.
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::updateTextInputState): Set ItemAcceptsInputMethod as soon as we
have editable content.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp