diff options
Diffstat (limited to 'components/script/dom/event.rs')
-rw-r--r-- | components/script/dom/event.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index fc18036bfc7..914cf279278 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -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 |