- From: ArkadiuszMichalski <notifications@github.com>
- Date: Wed, 13 Apr 2016 12:19:28 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Message-ID: <whatwg/dom/issues/219/209605497@github.com>
I see that behaviour for `Event.initEvent()` it's also inconsistent, this method should unset stop propagation flag, stop immediate propagation flag, and canceled flag. Even if `dispatchEvent()` not unset them by default then we should do this manually via `Event.initEvent()`.
https://dom.spec.whatwg.org/#dom-event-initevent
```js
<!DOCTYPE html>
<script>
var ev = document.createEvent("Event");
ev.stopPropagation();
ev.initEvent("type", false, false);
document.addEventListener("type", function() {alert("hello");}, false);
document.dispatchEvent(ev);
</script>
```
Only Chrome alerts.
```js
<!DOCTYPE html>
<script>
var ev = document.createEvent("Event");
ev.initEvent("type", false, false);
ev.stopPropagation();
document.addEventListener("type", function() {alert("hello");}, false);
document.dispatchEvent(ev);
ev.initEvent("type", false, false);
document.dispatchEvent(ev);
</script>
```
Only Firefox alerts.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/219#issuecomment-209605497
Received on Wednesday, 13 April 2016 19:19:56 UTC