New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for browser IME & on-screen-display keyboards #238

Merged
merged 10 commits into from Dec 18, 2013

Conversation

Projects
None yet
3 participants
@peitschie
Contributor

peitschie commented Dec 3, 2013

Add support for IMEs using the built-in browser composition capabilities. This has been tested in the following configurations

General

  • Using the arrow-keys whilst in composition moves the content-editable caret around, causing it to become visible.

MacOS

  • 馃憤 Chrome - IME fully functional + Option+char partially supported
  • 馃憤 FF - IME fully functional + Option+char partially supported
  • 馃憤 Safari - IME fully functional + Option+char partially supported

In another patch

  • Better support for Option+char
  • Support long-press character input

Long-press and some Option+char events do not work on MacOS, as they are rather strange combinations of textInput & keypress events.

Windows

  • 馃憤 Chrome - IME fully functional
  • 馃憤 FF - IME fully functional
  • 馃憤 Internet Explorer 11 - Typing still works normally, but composition has been crashing my test browser. Need to retest with the current head to see if this is still the case. Update: this seems to work pretty fine now actually. No crashing!
    • IE : Starting composition, then hitting the left or right arrow incorrectly moves the resulting character to the new place
    • IE: Selecting a block of text and attempting to overwrite it places the pressed char beside the new character being composed

Linux

  • 馃憤 Chrome - IME doesn't work at all. Linux IME appears to send some rather strange events. Potentially filtering can be added to help however? Update: fixed!
  • 馃憤 FF - IME fully functional

Android

  • 馃憥 Built-in browser - Document renders fine. No on-screen keyboard. Cursor placement appears to work however
  • 馃憥 Chrome mobile - On-screen keyboard vanishes after each word is complete
  • 馃憤 FF mobile - On-screen keyboard appears to work fine (if sluggish)

iPad v1

Jos said WebODF wasn't working at all (wasn't even showing editor chrome)

iPad v2

Unknown

Any other configurations/devices people can think of?

@kogmbh-ci

This comment has been minimized.

Show comment
Hide comment
@kogmbh-ci

kogmbh-ci Dec 13, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/570/

kogmbh-ci commented Dec 13, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/570/

@kogmbh-ci

This comment has been minimized.

Show comment
Hide comment
@kogmbh-ci

kogmbh-ci Dec 13, 2013

Build failed.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/573/

kogmbh-ci commented Dec 13, 2013

Build failed.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/573/

@kogmbh-ci

This comment has been minimized.

Show comment
Hide comment
@kogmbh-ci

kogmbh-ci Dec 13, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/574/

kogmbh-ci commented Dec 13, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/574/

@vandenoever

This comment has been minimized.

Show comment
Hide comment
@vandenoever

vandenoever Dec 17, 2013

Member

very nice! (as nice as browser workarounds can be)
ship it!

Member

vandenoever commented Dec 17, 2013

very nice! (as nice as browser workarounds can be)
ship it!

peitschie added some commits Dec 9, 2013

Make cursor sub-element CSS styles component-specific
Previous implementation was using the element type (span or div) to
determine if the element was a handle or caret. This is problematic if
additional elements are placed inside the cursor node (as necessary for
proper IME support)
Workaround for Firefox selection.collapse bug
Attempting to collapse a selection if a content editable element is the
current activeElement for the document will cause the collapse call to
throw an exception.

https://bugzilla.mozilla.org/show_bug.cgi?id=773137
https://bugzilla.mozilla.org/show_bug.cgi?id=787305
Support text input using the OS鈥檚 IME system
This change extends the use of the event trap to allow in-line character addition
using the OS's IME. The event trap will now be moved to within the local user's
cursor block, and will become visible when a composition start event is detected.

This has been tested on Chrome, FF & Safari on all platforms. In addition, this
enables support in FF on Android.

Known issues
- No IME support on Chrome under Linux. The compositionend event emitted by Chrome
contains no data, so the input character can't be detected.
Let EventManager.focus restore positions for all scrollable parents
Scrollable parents that had no current scroll offset were being ignored.
This meant that the view could end up reset at a non-0 scroll offset when
focus was restored to the event trap.
Support back-to-back composition end & start events
Some IMEs will stack end & start requests back to back. If the selection
is modified between an old and new session (e.g., via text updates), the
new composition session never starts. One mainstream example of this is
inputting text using MacOS鈥檚 option+char method
Workaround Safari post-composition key press event error
When composition session is ended on Safari under MacOS by pressing
another text char, Safari incorrectly reports the next keypress event鈥檚
鈥渨hich鈥 value as the last compositionend data, rather than the new key
that was pressed.
Workaround Chrome issues with Linux IMEs
In Chrome 31.0.1650.63 onUbuntu 13.10, the composed character isn't set
in the compositionend event. The text is added to the focused field
immediately after however in a textInput event. Firefox appears to be
unaffected by this bug.
Clean-up event trap more thoroughly after input
Repeated text entry events can result in lots of empty text nodes
@kogmbh-ci

This comment has been minimized.

Show comment
Hide comment
@kogmbh-ci

kogmbh-ci Dec 18, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/595/

kogmbh-ci commented Dec 18, 2013

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/595/

peitschie added a commit that referenced this pull request Dec 18, 2013

Merge pull request #238 from peitschie/ime-support
Add support for browser IME & on-screen-display keyboards

@peitschie peitschie merged commit 2472188 into kogmbh:master Dec 18, 2013

1 check passed

default Merged build finished.
Details

@peitschie peitschie deleted the peitschie:ime-support branch Dec 18, 2013

@peitschie peitschie referenced this pull request Dec 18, 2013

Closed

support chinese input #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment