diff options
author | Yuki Toyoda <toyoda_yuki@cyberagent.co.jp> | 2019-02-24 12:15:34 +0900 |
---|---|---|
committer | Yuki Toyoda <toyoda_yuki@cyberagent.co.jp> | 2019-03-03 16:55:22 +0900 |
commit | c1e96b452de522d348a7ae1d55cba746df520fb2 (patch) | |
tree | 1e9feb002359f34fe876b4803e3ae36d57d03d50 /components/script/dom/event.rs | |
parent | 4d8d54fc00644204768886569959429dd67998a0 (diff) | |
download | servo-c1e96b452de522d348a7ae1d55cba746df520fb2.tar.gz servo-c1e96b452de522d348a7ae1d55cba746df520fb2.zip |
implement historical cancelBubble attribute for Event interface
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 914cf279278..1be80dc7d36 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -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 |