Skip to content

Commit

Permalink
[BlackBerry] Use form state to determine the VKB enter key.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=94239

Reviewed by Rob Buis.

PR 188234.

If the enter key for the VKB is not explicitly set, use
submit if we are in a single line input and a default
button exists for the form.

Reviewed Internally by Gen Mak.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setElementFocused):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mfenton committed Aug 16, 2012
1 parent 609e1d5 commit 5b6af83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,21 @@
2012-08-16 Mike Fenton <mifenton@rim.com>

[BlackBerry] Use form state to determine the VKB enter key.
https://bugs.webkit.org/show_bug.cgi?id=94239

Reviewed by Rob Buis.

PR 188234.

If the enter key for the VKB is not explicitly set, use
submit if we are in a single line input and a default
button exists for the form.

Reviewed Internally by Gen Mak.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setElementFocused):

2012-08-16 Konrad Piascik <kpiascik@rim.com>

[BlackBerry] Reload valid page from Error Page keeps history ViewState and zoom.
Expand Down
8 changes: 8 additions & 0 deletions Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
Expand Up @@ -818,6 +818,14 @@ void InputHandler::setElementFocused(Element* element)
VirtualKeyboardType keyboardType = keyboardTypeAttribute(element);
VirtualKeyboardEnterKeyType enterKeyType = keyboardEnterKeyTypeAttribute(element);

if (enterKeyType == VKBEnterKeyNotSet && type != InputTypeTextArea) {
if (element->isFormControlElement()) {
const HTMLFormControlElement* formElement = static_cast<const HTMLFormControlElement*>(element);
if (formElement->form() && formElement->form()->defaultButton())
enterKeyType = VKBEnterKeySubmit;
}
}

FocusLog(LogLevelInfo, "InputHandler::setElementFocused, Type=%d, Style=%d, Keyboard Type=%d, Enter Key=%d", type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
m_webPage->m_client->inputFocusGained(type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);

Expand Down

0 comments on commit 5b6af83

Please sign in to comment.