diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-11-20 03:32:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 03:32:25 -0500 |
commit | 98527ddb8cd03db965c8b78f1b01095623ed9702 (patch) | |
tree | af93eac897780b7d6fe6918b0abc6537f7472846 /components/webdriver_server/lib.rs | |
parent | f1dd31f70440fa9c7a40525bd1e03eede568f74d (diff) | |
parent | b936fea79de985213c053e67f77458b37f4b2995 (diff) | |
download | servo-98527ddb8cd03db965c8b78f1b01095623ed9702.tar.gz servo-98527ddb8cd03db965c8b78f1b01095623ed9702.zip |
Auto merge of #22224 - pyfisch:composition-webdriver, r=nox
Forward WebDriver CompositionEvent
Dispatch composition events in JS.
Insert characters from composition events to text input.
CompositionEvents currently can only be
created by WebDriver and not by embedders.
<!-- Please describe your changes on the following line: -->
---
<!-- 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. -->
<!-- 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/22224)
<!-- Reviewable:end -->
Diffstat (limited to 'components/webdriver_server/lib.rs')
-rw-r--r-- | components/webdriver_server/lib.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 6cf418c5d62..77e16d399dc 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -17,7 +17,7 @@ use euclid::TypedSize2D; use hyper::Method; use image::{DynamicImage, ImageFormat, RgbImage}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; -use keyboard_types::webdriver::{send_keys, Event as KeyEvent}; +use keyboard_types::webdriver::send_keys; use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, TraversalDirection}; use net_traits::image::base::PixelFormat; use regex::Captures; @@ -1036,19 +1036,12 @@ impl Handler { )) })?; - // FIXME: Don't discard composition events. - let keys = send_keys(&keys.text) - .drain(..) - .filter_map(|event| match event { - KeyEvent::Keyboard(v) => Some(v), - _ => None, - }) - .collect(); + let input_events = send_keys(&keys.text); // TODO: there's a race condition caused by the focus command and the // send keys command being two separate messages, // so the constellation may have changed state between them. - let cmd_msg = WebDriverCommandMsg::SendKeys(browsing_context_id, keys); + let cmd_msg = WebDriverCommandMsg::SendKeys(browsing_context_id, input_events); self.constellation_chan .send(ConstellationMsg::WebDriverCommand(cmd_msg)) .unwrap(); |