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

View file

@ -20,6 +20,7 @@ interface Event {
readonly attribute unsigned short eventPhase;
void stopPropagation();
attribute boolean cancelBubble;
void stopImmediatePropagation();
[Pure]

View file

@ -1,26 +0,0 @@
[Event-cancelBubble.html]
type: testharness
[cancelBubble must be false when an event is initially created.]
expected: FAIL
[Initializing an event must set cancelBubble to false.]
expected: FAIL
[stopPropagation() must set cancelBubble to true.]
expected: FAIL
[stopImmediatePropagation() must set cancelBubble to true.]
expected: FAIL
[Event.cancelBubble=false must have no effect.]
expected: FAIL
[Event.cancelBubble=false must have no effect during event propagation.]
expected: FAIL
[cancelBubble must be false after an event has been dispatched.]
expected: FAIL
[Event.cancelBubble=true must set the stop propagation flag.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[Event-dispatch-bubble-canceled.html]
type: testharness
[Setting cancelBubble=true prior to dispatchEvent()]
expected: FAIL

View file

@ -1,5 +0,0 @@
[Event-dispatch-multiple-cancelBubble.html]
type: testharness
[Multiple dispatchEvent() and cancelBubble]
expected: FAIL

View file

@ -1,7 +1,5 @@
[Event-initEvent.html]
type: testharness
[Calling initEvent must unset the stop propagation flag.]
expected: FAIL
[Properties of initEvent(type, true, true)]
expected: FAIL

View file

@ -1,5 +0,0 @@
[Event-propagation.html]
type: testharness
[After cancelBubble=true]
expected: FAIL

View file

@ -1262,18 +1262,6 @@
[Window interface: attribute event]
expected: FAIL
[Event interface: attribute cancelBubble]
expected: FAIL
[Event interface: document.createEvent("Event") must inherit property "cancelBubble" with the proper type]
expected: FAIL
[Event interface: new Event("foo") must inherit property "cancelBubble" with the proper type]
expected: FAIL
[Event interface: new CustomEvent("foo") must inherit property "cancelBubble" with the proper type]
expected: FAIL
[Document interface: operation prepend([object Object\],[object Object\])]
expected: FAIL