mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
queue event instead of immediately fire
created checks to see if parser is in use before event dispatch changed tests to expect crash and added async style test
This commit is contained in:
parent
462409ada5
commit
79d896d474
9 changed files with 72 additions and 3 deletions
|
@ -315,10 +315,21 @@ impl EventTarget {
|
|||
pub fn dispatch_event_with_target(&self,
|
||||
target: &EventTarget,
|
||||
event: &Event) -> EventStatus {
|
||||
if let Some(window) = target.global().downcast::<Window>() {
|
||||
if window.has_document() {
|
||||
assert!(window.Document().can_invoke_script());
|
||||
}
|
||||
};
|
||||
|
||||
event.dispatch(self, Some(target))
|
||||
}
|
||||
|
||||
pub fn dispatch_event(&self, event: &Event) -> EventStatus {
|
||||
if let Some(window) = self.global().downcast::<Window>() {
|
||||
if window.has_document() {
|
||||
assert!(window.Document().can_invoke_script());
|
||||
}
|
||||
};
|
||||
event.dispatch(self, None)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue