mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Sending key events through script task before processing them in the compositor.
Fixes #4163
This commit is contained in:
parent
f451005f4f
commit
b0552cb98e
10 changed files with 131 additions and 66 deletions
|
@ -505,11 +505,12 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLInputElement> {
|
|||
} else if "keydown" == event.Type().as_slice() && !event.DefaultPrevented() &&
|
||||
(self.input_type.get() == InputText || self.input_type.get() == InputPassword) {
|
||||
let keyevent: Option<JSRef<KeyboardEvent>> = KeyboardEventCast::to_ref(event);
|
||||
keyevent.map(|event| {
|
||||
match self.textinput.borrow_mut().handle_keydown(event) {
|
||||
keyevent.map(|keyevent| {
|
||||
match self.textinput.borrow_mut().handle_keydown(keyevent) {
|
||||
TriggerDefaultAction => (),
|
||||
DispatchInput => {
|
||||
self.force_relayout();
|
||||
event.PreventDefault();
|
||||
}
|
||||
Nothing => (),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue