Skip to content

Commit

Permalink
[BlackBerry] Use the unconverted attribute instead of composing when …
Browse files Browse the repository at this point in the history
…deciding to how to handle key input.

https://bugs.webkit.org/show_bug.cgi?id=94132

Reviewed by Rob Buis.

PR 139838.

Switch direct key input handling to be based on the unconverted
attribute being present.  Converted keys, even during composition
are now input directly.

Reviewed Internally by Nima Ghanavatian.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mfenton committed Aug 15, 2012
1 parent 85e5fdd commit 8fd6ed8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
18 changes: 18 additions & 0 deletions Source/WebKit/blackberry/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2012-08-15 Mike Fenton <mifenton@rim.com>

[BlackBerry] Use the unconverted attribute instead of composing when deciding to how to handle key input.
https://bugs.webkit.org/show_bug.cgi?id=94132

Reviewed by Rob Buis.

PR 139838.

Switch direct key input handling to be based on the unconverted
attribute being present. Converted keys, even during composition
are now input directly.

Reviewed Internally by Nima Ghanavatian.

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

2012-08-15 Joshua Netterfield <jnetterfield@rim.com>

[BlackBerry] Upstream BlackBerry build fixes
Expand Down
9 changes: 5 additions & 4 deletions Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2013,12 +2013,13 @@ bool InputHandler::setText(spannable_string_t* spannableString)
removeAttributedTextMarker();

if (isTrailingSingleCharacter(changedSpan, textLength, composingTextLength)) {
// Handle the case where text is being composed.
if (firstSpanInString(spannableString, COMPOSED_TEXT_ATTRIB)) {
InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is being composed.");
// If the text is unconverted, do not allow JS processing as it is not a "real"
// character in the field.
if (firstSpanInString(spannableString, UNCONVERTED_TEXT_ATTRIB)) {
InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is unconverted.");
return editor->command("InsertText").execute(textToInsert.right(1));
}
InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is not being composed.");
InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected.");
return handleKeyboardInput(Platform::KeyboardEvent(textToInsert[textLength - 1], Platform::KeyboardEvent::KeyChar, 0), false /* changeIsPartOfComposition */);
}

Expand Down

0 comments on commit 8fd6ed8

Please sign in to comment.