You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing #750 in jsdom (jsdom/jsdom#2536), we had to change the following test, which I believe originates from some old DOM level 2 test suite.
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.)
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.
The text was updated successfully, but these errors were encountered:
I suspect what's going on here is that stopPropagation() now affects listeners on the same target, due to us copying the listeners for capture and bubbling separately there. So yeah, this seems as intended.
When implementing #750 in jsdom (jsdom/jsdom#2536), we had to change the following test, which I believe originates from some old DOM level 2 test suite.
The
atEvents.length
will increase every time the event is in theAT_TARGET
phase. (Code link.)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.
The text was updated successfully, but these errors were encountered: