Commit graph

18 commits

Author SHA1 Message Date
Bastien Orivel
9a7eeb349a Update crossbeam-channel to 0.3 2018-11-18 19:33:19 +01:00
Pyfisch
2143657e03 Use keyboard-types::webdriver::send_keys
This improves the quality of KeyboardEvents
sent by WebDriver. Now key, code, location and
modifiers are set according to spec.
CompositionEvents are discarded as servo
does not handle them at all.
2018-11-11 21:57:45 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Simon Sapin
9f9bf8f6bc Switch most crates to the 2018 edition 2018-11-06 16:12:04 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
bors-servo
9a0404ac5f
Auto merge of #21881 - pyfisch:keyboard-types, r=paulrouget
Use keyboard-types crate

Have embedders send DOM keys to servo and use a strongly typed KeyboardEvent
from the W3C UI Events spec. All keyboard handling now uses the new types.

Introduce a ShortcutMatcher to recognize key bindings. Shortcuts are now
recognized in a uniform way.

Updated the winit port.
Updated webdriver integration.

part of #20331

What this PR does:

* allow the use non-ASCII keyboards for text input
* decouple keyboard event "key" from "code" (key meaning vs location)

What this PR does not do:

* completely improve keyboard events send from winit and webdriver
* add support for CompositionEvent or IME

Notes:

* The winit embedder does not send keyup events for printable keys (this is a regression)
* keyboard-types is on crates.io because I believe it to be useful outside of servo. If you prefer I can add a copy in this repo.

<!-- 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/21881)
<!-- Reviewable:end -->
2018-10-17 05:36:08 -04:00
Pyfisch
c8619424f2 Minor keyboard updates
Support combined character input from winit.
Make use of utility methods from keyboard-types.
Remove prinatable attribute of KeyboardEvent.
2018-10-13 20:30:30 +02:00
Pyfisch
0ccaa7e1a9 Use keyboard-types crate
Have embedders send DOM keys to servo and use a strongly typed KeyboardEvent
from the W3C UI Events spec. All keyboard handling now uses the new types.

Introduce a ShortcutMatcher to recognize key bindings. Shortcuts are now
recognized in a uniform way.

Updated the winit port.
Updated webdriver integration.

part of #20331
2018-10-07 22:39:00 +02:00
Simon Sapin
1f7ebfc8a2 Make mach test-unit not recompile components after mach build
Previously, the `tests` feature flag of the `embedder_traits` crate
caused it and every crate recursively depending on it to be built twice.

This feature flag was used to provide a specific set of "resources"
when running tests. Instead, this commits overrides the `main()` function
of the test harness to change resources at runtime before running any test.

This is done by adding a dependency that has `name = "test"` in its
`[lib]` section of `Cargo.toml`. This overrides the crate found by
`extern crate test;` in code generated by `rustc --test`.
2018-10-07 13:27:23 +02:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
kingdido999
d76ddabba4 Format components dom_struct, domobject_derive and embedder_traits #21373 2018-09-03 08:19:25 +08:00
Gregory Terzian
f408b798c4 implement window.open, create auxiliary browsing context 2018-08-11 01:12:55 +02:00
Gregory Terzian
2753e5efab improve spec compliance of window.close 2018-06-04 15:02:23 +08:00
Gregory Terzian
2812b3cf4a send message to embedder in prompt_to_unload 2018-05-23 21:46:05 +08:00
Gregory Terzian
4234b1252a move top_level_browsing_context_id out of embedder msg 2018-05-23 21:46:05 +08:00
Gregory Terzian
d438240772 move msg to embedder_traits, use in script, handle send error in embedder 2018-05-23 21:45:57 +08:00
Paul Rouget
e02a23b2f6 Automatically provide a resource reader for tests 2018-04-30 22:19:33 +08:00
Paul Rouget
9fb5795f37 delegate resource reading to embedder 2018-04-27 15:34:52 +08:00