24 lines
765 B
Plaintext
24 lines
765 B
Plaintext
Tests support for 'passive' member in AddEventListenerOptions.
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
document.body.addEventListener('test', passiveListenerFunction, { 'passive': true })
|
|
document.body.dispatchEvent(testEvent1)
|
|
PASS listenerCallCount is 1
|
|
PASS testEvent1.defaultPrevented is false
|
|
|
|
document.body.addEventListener('test', activeListenerFunction, { })
|
|
document.body.dispatchEvent(testEvent2)
|
|
PASS listenerCallCount is 2
|
|
PASS testEvent2.defaultPrevented is true
|
|
|
|
document.body.addEventListener('test', activeListenerFunction, { 'passive': false })
|
|
document.body.dispatchEvent(testEvent2)
|
|
PASS listenerCallCount is 2
|
|
PASS testEvent2.defaultPrevented is true
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|