mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +01:00
parent
97710f0739
commit
832cfac747
1 changed files with 10 additions and 3 deletions
|
@ -798,12 +798,19 @@ impl Document {
|
|||
match key {
|
||||
Key::Space if !prevented && state == KeyState::Released => {
|
||||
let maybe_elem: Option<&Element> = ElementCast::to_ref(target);
|
||||
maybe_elem.map(
|
||||
|el| el.as_maybe_activatable().map(|a| a.synthetic_click_activation(ctrl, alt, shift, meta)));
|
||||
if let Some(el) = maybe_elem {
|
||||
if let Some(a) = el.as_maybe_activatable() {
|
||||
a.synthetic_click_activation(ctrl, alt, shift, meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
Key::Enter if !prevented && state == KeyState::Released => {
|
||||
let maybe_elem: Option<&Element> = ElementCast::to_ref(target);
|
||||
maybe_elem.map(|el| el.as_maybe_activatable().map(|a| a.implicit_submission(ctrl, alt, shift, meta)));
|
||||
if let Some(el) = maybe_elem {
|
||||
if let Some(a) = el.as_maybe_activatable() {
|
||||
a.implicit_submission(ctrl, alt, shift, meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue