Implement historical returnValue attribute for Event interface

This commit is contained in:
Patrick Ngai 2019-02-24 23:58:51 +08:00
parent 427003210b
commit fcadff7bad
6 changed files with 13 additions and 42 deletions

View file

@ -297,6 +297,18 @@ impl EventMethods for Event {
self.cancelable.get()
}
// https://dom.spec.whatwg.org/#dom-event-returnvalue
fn ReturnValue(&self) -> bool {
self.canceled.get() == EventDefault::Allowed
}
// https://dom.spec.whatwg.org/#dom-event-returnvalue
fn SetReturnValue(&self, val: bool) {
if !val {
self.PreventDefault();
}
}
// https://dom.spec.whatwg.org/#dom-event-timestamp
fn TimeStamp(&self) -> u64 {
self.timestamp