[webkit-reviews] review granted: [Bug 30023] [Qt] Software input panel is not launched for password fields : [Attachment 40910] [Qt] patch to set Qt::WA_InputMethodEnabled attribute for password fields in EditorClientQt::setInputMethodState

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 9 07:41:03 PDT 2009


Simon Hausmann <hausmann at webkit.org> has granted Joseph Ligman
<joseph.ligman at nokia.com>'s request for review:
Bug 30023: [Qt] Software input panel is not launched for password fields
https://bugs.webkit.org/show_bug.cgi?id=30023

Attachment 40910: [Qt] patch to set Qt::WA_InputMethodEnabled attribute for
password fields in EditorClientQt::setInputMethodState 
https://bugs.webkit.org/attachment.cgi?id=40910&action=review

------- Additional Comments from Simon Hausmann <hausmann at webkit.org>

> +    QWebPageClient* webPageClient = m_page->d->client;
> +    if (webPageClient) {
> +#if QT_VERSION >= 0x040600
> +	   Qt::InputMethodHints hints = Qt::ImhNone;
> +	   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 = inputElement->isPasswordField();
> +		       if (active)
> +			   hints |= Qt::ImhHiddenText;
> +		 }
> +	       }
> +	   }
> +	   webPageClient->setInputMethodHint(Qt::ImhHiddenText, hints &
Qt::ImhHiddenText);

You could probably simplify this by replacing the local "hints" variable with
just a boolean :-)

Feel free to make that small change before landing, or change it in a follow-up
patch.

The rest of the patch looks good. Thanks Joe!


More information about the webkit-reviews mailing list