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 upNotify the embedder when it should display or hide an IME #20676
Conversation
highfive
commented
Apr 21, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 21, 2018
| @@ -1247,6 +1247,14 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| FromScriptMsg::SetFullscreenState(state) => { | |||
| self.embedder_proxy.send(EmbedderMsg::SetFullscreenState(source_top_ctx_id, state)); | |||
| } | |||
| FromScriptMsg::ShowIME(kind) => { | |||
| debug!("constellation got ShowIME message"); | |||
| self.embedder_proxy.send(EmbedderMsg::ShowIME(source_top_ctx_id, kind)); | |||
This comment has been minimized.
This comment has been minimized.
cbrewster
Apr 21, 2018
Member
I think I would rather have us talk to the embedder from the script thread instead of going through the constellation.
This comment has been minimized.
This comment has been minimized.
fabricedesre
Apr 21, 2018
Author
Contributor
I didn't know this was a thing since we don't do it for other cases like TitleChange.
This comment has been minimized.
This comment has been minimized.
cbrewster
Apr 21, 2018
Member
IRC Chat: https://mozilla.logbot.info/servo/20180421#c14649458-c14649484
TL;DR: We should avoid adding lots of cases where the constellation is only forwarding a message when the message could be sent directly. But, I would be okay if this were a followup that removed other instances of this.
Also in the case of TitleChange, the constellation is checking if the source pipeline was the top-level pipeline.
|
|
||
| if let Some(input) = self.downcast::<HTMLInputElement>() { | ||
| input.input_type().as_ime_type() | ||
| } else if let Some(_textarea) = self.downcast::<HTMLTextAreaElement>() { |
This comment has been minimized.
This comment has been minimized.
| @@ -163,6 +163,10 @@ pub enum ScriptMsg { | |||
| GetScreenSize(IpcSender<(DeviceUintSize)>), | |||
| /// Get the available screen size (pixel) | |||
| GetScreenAvailSize(IpcSender<(DeviceUintSize)>), | |||
| /// Request to present an IME to the user when an editable element is focused. | |||
| ShowIME(InputMethodType), | |||
| /// Request to hide the IME when the editable element is blured. | |||
This comment has been minimized.
This comment has been minimized.
2e1c978
to
4288661
|
@cbrewster Is there anything left for me to do here? |
|
LGTM @bors-servo r+ |
|
|
Notify the embedder when it should display or hide an IME <!-- Please describe your changes on the following line: --> This adds a couple of embedder messages triggered when an editable element is focused or blured. The embedder also gets the type of data to edit so it can display a different keyboard type or a custom input method eg. for color choosing. This is a partial fix for issue #12127 --- <!-- 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 build-geckolib` 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 - [X] These changes do not require tests because there are no tests for the embedding api :( <!-- 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20676) <!-- Reviewable:end -->
|
|
fabricedesre commentedApr 21, 2018
•
edited by SimonSapin
This adds a couple of embedder messages triggered when an editable element is focused or blured. The embedder also gets the type of data to edit so it can display a different keyboard type or a custom input method eg. for color choosing.
This is a partial fix for issue #12127
./mach build -ddoes not report any errors./mach build-geckolibdoes not report any errors./mach test-tidydoes not report any errorsThis change is