implement historical cancelBubble attribute for Event interface

This commit is contained in:
Yuki Toyoda 2019-02-24 12:15:34 +09:00
parent 4d8d54fc00
commit c1e96b452d
8 changed files with 13 additions and 55 deletions

View file

@ -309,6 +309,18 @@ impl EventMethods for Event {
}
}
// https://dom.spec.whatwg.org/#dom-event-cancelbubble
fn CancelBubble(&self) -> bool {
self.stop_propagation.get()
}
// https://dom.spec.whatwg.org/#dom-event-cancelbubble
fn SetCancelBubble(&self, value: bool) {
if value {
self.stop_propagation.set(true)
}
}
// https://dom.spec.whatwg.org/#dom-event-timestamp
fn TimeStamp(&self) -> u64 {
self.timestamp