- From: Domenic Denicola <notifications@github.com>
- Date: Sun, 12 May 2019 09:37:46 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/759@github.com>
When implementing #750 in jsdom (https://github.com/jsdom/jsdom/pull/2536), we had to change the following test, which I believe originates from some old DOM level 2 test suite. ```diff specify('stopPropagation should not prevent listeners on the same element from receiving the event', () => { this.win.addEventListener("foo", this.monitor.handleEvent, false); this.body.addEventListener("foo", this.monitor.handleEvent, false); this.plist.addEventListener("foo", this._handleEvent('stopPropagation'), true); this.plist.addEventListener("foo", this._handleEvent('stopPropagation'), false); this.plist.addEventListener("foo", this.monitor.handleEvent, true); this.plist.addEventListener("foo", this.monitor.handleEvent, false); this.plist.dispatchEvent(this.event); - assert.equal(this.monitor.atEvents.length, 4, 'should be at 4 events'); + assert.equal(this.monitor.atEvents.length, 2, 'should be at 2 events'); // Changed from 4 to 2 assert.equal(this.monitor.bubbledEvents.length, 0, 'should have no bubbled events'); assert.equal(this.monitor.capturedEvents.length, 0, 'should have no captured events'); }); ``` The `atEvents.length` will increase every time the event is in the `AT_TARGET` phase. ([Code link](https://github.com/jsdom/jsdom/blob/0c389bc9067c1f914b1dc9696a2345eb4c9035c2/test/to-port-to-wpts/level2/events.js#L8).) A lot of thought seems to have gone into the recent event changes, so this is probably fine. But I wanted to highlight this in case anyone with more knowledge had concerns. /cc @rniwa. -- 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/759
Received on Sunday, 12 May 2019 16:38:09 UTC