aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorYuki Toyoda <toyoda_yuki@cyberagent.co.jp>2019-02-24 12:15:34 +0900
committerYuki Toyoda <toyoda_yuki@cyberagent.co.jp>2019-03-03 16:55:22 +0900
commitc1e96b452de522d348a7ae1d55cba746df520fb2 (patch)
tree1e9feb002359f34fe876b4803e3ae36d57d03d50 /components/script
parent4d8d54fc00644204768886569959429dd67998a0 (diff)
downloadservo-c1e96b452de522d348a7ae1d55cba746df520fb2.tar.gz
servo-c1e96b452de522d348a7ae1d55cba746df520fb2.zip
implement historical cancelBubble attribute for Event interface
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/event.rs12
-rw-r--r--components/script/dom/webidls/Event.webidl1
2 files changed, 13 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
diff --git a/components/script/dom/webidls/Event.webidl b/components/script/dom/webidls/Event.webidl
index 1a6fd8e4a5c..f6074bd68f3 100644
--- a/components/script/dom/webidls/Event.webidl
+++ b/components/script/dom/webidls/Event.webidl
@@ -20,6 +20,7 @@ interface Event {
readonly attribute unsigned short eventPhase;
void stopPropagation();
+ attribute boolean cancelBubble;
void stopImmediatePropagation();
[Pure]