mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
#4508 Adding simple test and actually getting the event to dispatch
This commit is contained in:
parent
5938a4c0f5
commit
0bd717e470
3 changed files with 21 additions and 6 deletions
|
@ -629,7 +629,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
|||
ctrl, alt, shift, meta,
|
||||
None, props.key_code).root();
|
||||
let event = EventCast::from_ref(keyevent.r());
|
||||
let _ = target.DispatchEvent(event);
|
||||
event.fire(target);
|
||||
let mut prevented = event.DefaultPrevented();
|
||||
|
||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#keys-cancelable-keys
|
||||
|
@ -642,7 +642,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
|||
ctrl, alt, shift, meta,
|
||||
props.char_code, 0).root();
|
||||
let ev = EventCast::from_ref(event.r());
|
||||
let _ = target.DispatchEvent(ev);
|
||||
ev.fire(target);
|
||||
prevented = ev.DefaultPrevented();
|
||||
// TODO: if keypress event is canceled, prevent firing input events
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue