Changeset 64737 in webkit
- Timestamp:
- Aug 5, 2010 5:40:08 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64735 r64737 1 2010-08-05 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Reviewed by Tor Arne Vestbø. 4 5 [Qt] Clean up the input method handling 6 https://bugs.webkit.org/show_bug.cgi?id=43545 7 8 Changed input method hint interface to be more efficient by setting 9 all hints in one shot, like in QWidget. 10 11 * platform/qt/QWebPageClient.h: 12 1 13 2010-08-05 Yury Semikhatsky <yurys@chromium.org> 2 14 -
trunk/WebCore/platform/qt/QWebPageClient.h
r61342 r64737 60 60 61 61 #if QT_VERSION >= 0x040600 62 virtual void setInputMethodHint (Qt::InputMethodHint hint, bool enable) = 0;62 virtual void setInputMethodHints(Qt::InputMethodHints hint) = 0; 63 63 #endif 64 64 -
trunk/WebKit/qt/ChangeLog
r64725 r64737 1 2010-08-05 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Reviewed by Tor Arne Vestbø. 4 5 [Qt] Clean up the input method handling 6 https://bugs.webkit.org/show_bug.cgi?id=43545 7 8 Replace the way of individually setting input method hints by 9 many calls to QWidget::setInputMethodHints with one single call. 10 11 This is more efficient by requiring less updates in the input 12 method hint. 13 14 * WebCoreSupport/EditorClientQt.cpp: 15 (WebCore::EditorClientQt::setInputMethodState): 16 * WebCoreSupport/PageClientQt.cpp: 17 (WebCore::PageClientQWidget::setInputMethodHints): 18 (WebCore::PageClientQGraphicsWidget::setInputMethodHints): 19 * WebCoreSupport/PageClientQt.h: 20 1 21 2010-08-05 David Leong <david.leong@nokia.com> 2 22 -
trunk/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r64725 r64737 597 597 if (webPageClient) { 598 598 #if QT_VERSION >= 0x040600 599 // Make sure to reset input method hint 600 webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, false); 601 webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, false); 602 webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, false); 603 webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, false); 604 webPageClient->setInputMethodHint(Qt::ImhHiddenText, false); 599 Qt::InputMethodHints hints; 605 600 606 601 HTMLInputElement* inputElement = 0; … … 612 607 if (inputElement) { 613 608 // Set input method hints for "number", "tel", "email", "url" and "password" input elements. 614 webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); 615 webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); 616 webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); 617 webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); 609 if (inputElement->isTelephoneField()) 610 hints |= Qt::ImhDialableCharactersOnly; 611 if (inputElement->isNumberField()) 612 hints |= Qt::ImhDigitsOnly; 613 if (inputElement->isEmailField()) 614 hints |= Qt::ImhEmailCharactersOnly; 615 if (inputElement->isUrlField()) 616 hints |= Qt::ImhUrlCharactersOnly; 618 617 // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag 619 618 // for password fields. The Qt platform is responsible for determining which widget 620 619 // will receive input method events for password fields. 621 bool isPasswordField = inputElement->isPasswordField(); 622 webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); 623 if (isPasswordField) 620 if (inputElement->isPasswordField()) { 624 621 active = true; 622 hints |= Qt::ImhHiddenText; 623 } 625 624 } 626 625 627 626 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) 628 627 // disables auto-uppercase and predictive text for mobile devices 629 webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true);630 webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true);628 hints |= Qt::ImhNoAutoUppercase; 629 hints |= Qt::ImhNoPredictiveText; 631 630 #endif // Q_WS_MAEMO_5 || Q_WS_MAEMO_6 || Q_OS_SYMBIAN 631 webPageClient->setInputMethodHints(hints); 632 632 #endif // QT_VERSION check 633 633 webPageClient->setInputMethodEnabled(active); -
trunk/WebKit/qt/WebCoreSupport/PageClientQt.cpp
r63740 r64737 50 50 51 51 #if QT_VERSION >= 0x040600 52 void PageClientQWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable) 53 { 54 if (enable) 55 view->setInputMethodHints(view->inputMethodHints() | hint); 56 else 57 view->setInputMethodHints(view->inputMethodHints() & ~hint); 52 void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints) 53 { 54 view->setInputMethodHints(hints); 58 55 } 59 56 #endif … … 234 231 235 232 #if QT_VERSION >= 0x040600 236 void PageClientQGraphicsWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable) 237 { 238 if (enable) 239 view->setInputMethodHints(view->inputMethodHints() | hint); 240 else 241 view->setInputMethodHints(view->inputMethodHints() & ~hint); 233 void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints) 234 { 235 view->setInputMethodHints(hints); 242 236 } 243 237 #endif -
trunk/WebKit/qt/WebCoreSupport/PageClientQt.h
r63740 r64737 60 60 virtual bool inputMethodEnabled() const; 61 61 #if QT_VERSION >= 0x040600 62 virtual void setInputMethodHint (Qt::InputMethodHint hint, bool enable);62 virtual void setInputMethodHints(Qt::InputMethodHints hints); 63 63 #endif 64 64 … … 148 148 virtual bool inputMethodEnabled() const; 149 149 #if QT_VERSION >= 0x040600 150 virtual void setInputMethodHint (Qt::InputMethodHint hint, bool enable);150 virtual void setInputMethodHints(Qt::InputMethodHints hints); 151 151 #endif 152 152
Note: See TracChangeset
for help on using the changeset viewer.