mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Implement 'beforescriptexecute' and 'afterscriptexecute' events.
Spec: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block, sections 2.b.2 & 2.b.9
This commit is contained in:
parent
259792e481
commit
0b085df1bc
3 changed files with 55 additions and 29 deletions
|
@ -246,7 +246,7 @@ impl<'a> EventMethods for JSRef<'a, Event> {
|
|||
|
||||
pub trait EventHelpers {
|
||||
fn set_trusted(self, trusted: bool);
|
||||
fn fire(self, target: JSRef<EventTarget>);
|
||||
fn fire(self, target: JSRef<EventTarget>) -> bool;
|
||||
}
|
||||
|
||||
impl<'a> EventHelpers for JSRef<'a, Event> {
|
||||
|
@ -255,8 +255,8 @@ impl<'a> EventHelpers for JSRef<'a, Event> {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event
|
||||
fn fire(self, target: JSRef<EventTarget>) {
|
||||
fn fire(self, target: JSRef<EventTarget>) -> bool {
|
||||
self.set_trusted(true);
|
||||
target.dispatch_event(self);
|
||||
target.dispatch_event(self)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue