Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upComposition event doesn't trigger correctly for IME #24724
Comments
|
Found this commit In this commit message, it clearly said "CompositionEvents currently can only be created by WebDriver and not by embedders." To handle composition events correctly, we need to know the current character status of IME editor, but it seems winit sends only key release event and this event doesn't contain the status of IME (at least my Linux x11 environment. I checked the event interface, but looks like there is no interface for it). I think we should implement IME event handler in winit first. |
|
Relevant to this, document.createEvent currently isn't supporting the "CompositionEvent" or "TextEvent" strings. WPT dom/nodes/Document-createEvent.https.html expects it to so it can make mock CompositionEvents, and I imagine webapps might themselves use mock CompositionEvents for in-app touchscreen input methods. |
|
In rust-windowing/winit#753, they are discussing to introduce a new keyboard input model. This would be a breaking change, but could resolve those kind of keyboard events problems. However, the discussion seems to paused for a while. |
|
@pshaughn I checked that part, but it is not directly related to my problem. Actually, there are some components to handle CompositionEvent in servo itself. But the problem here is we cannot generate composition event from hardware events since abstracted hardware events which are generated by dependent library (winit) loses information which need to know to trigger composition events. |
implement composition event creation in Document.createEvent Solved the problem entioned in #24724 (comment) Add logic to create composition event for Document.createEvent. This resolved some WPT test failure, so updated the metadata as well Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
implement composition event creation in Document.createEvent Solved the problem mentioned in #24724 (comment) Add logic to create composition event for Document.createEvent. This resolved some WPT test failure, so updated the metadata as well Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
implement composition event creation in Document.createEvent Solved the problem mentioned in #24724 (comment) Add logic to create composition event for Document.createEvent. This resolved some WPT test failure, so updated the metadata as well Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
implement composition event creation in Document.createEvent Solved the problem mentioned in #24724 (comment) Add logic to create composition event for Document.createEvent. This resolved some WPT test failure, so updated the metadata as well Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
I submitted a PR to winit to support composition event in X11 environment rust-windowing/winit#1404 |
In #22346 , I found that composition start evnet doesn't trigger when I started to input something in IME. My test environment was Ubuntu 18.04 with fcitx IME.
Ref: https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event
The keyboard event itself comes from winit library. I also found some of issues mentioning about IME. So, the root cause might be winit library itself.