mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Reorder the code in dispatch_event a bit.
This commit is contained in:
parent
9ddeec09c3
commit
15717173ee
1 changed files with 2 additions and 3 deletions
|
@ -24,8 +24,6 @@ pub fn dispatch_event(target: &EventTarget, pseudo_target: Option<&EventTarget>,
|
||||||
});
|
});
|
||||||
event.set_dispatching(true);
|
event.set_dispatching(true);
|
||||||
|
|
||||||
let type_ = event.Type();
|
|
||||||
|
|
||||||
//TODO: no chain if not participating in a tree
|
//TODO: no chain if not participating in a tree
|
||||||
let mut chain: RootedVec<JS<EventTarget>> = RootedVec::new();
|
let mut chain: RootedVec<JS<EventTarget>> = RootedVec::new();
|
||||||
if let Some(target_node) = NodeCast::to_ref(target) {
|
if let Some(target_node) = NodeCast::to_ref(target) {
|
||||||
|
@ -35,9 +33,10 @@ pub fn dispatch_event(target: &EventTarget, pseudo_target: Option<&EventTarget>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event.set_phase(EventPhase::Capturing);
|
let type_ = event.Type();
|
||||||
|
|
||||||
/* capturing */
|
/* capturing */
|
||||||
|
event.set_phase(EventPhase::Capturing);
|
||||||
for cur_target in chain.r().iter().rev() {
|
for cur_target in chain.r().iter().rev() {
|
||||||
let stopped = match cur_target.get_listeners_for(&type_, ListenerPhase::Capturing) {
|
let stopped = match cur_target.get_listeners_for(&type_, ListenerPhase::Capturing) {
|
||||||
Some(listeners) => {
|
Some(listeners) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue