RESOLVED FIXED Bug 154245
Regression(r196563): It is no longer possible to call window.addEventListener without an explicit 'this'
https://bugs.webkit.org/show_bug.cgi?id=154245
Summary Regression(r196563): It is no longer possible to call window.addEventListener...
Chris Dumez
Reported 2016-02-15 09:02:48 PST
Regression(r196563): It is no longer possible to call window.addEventListener without an explicit 'this'. E.g. the following no longer works: var f = window.addEventListener f.call(undefined, "click", function() {}); It should use the global window object. This is causing Dromaeo/cssquery-dojo.html to fail.
Attachments
Patch (5.83 KB, patch)
2016-02-15 09:45 PST, Chris Dumez
no flags
Patch (6.22 KB, patch)
2016-02-15 12:09 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-02-15 09:45:55 PST
Ryosuke Niwa
Comment 2 2016-02-15 12:03:20 PST
Comment on attachment 271346 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=271346&action=review > LayoutTests/fast/dom/Window/addEventListener-implicit-this.html:23 > +bodyDispatchEventFunction = document.body.dispatchEvent; > +shouldBeTrue("bodyDispatchEventFunction.call(undefined, new Event('myevent'))"); Why don't we try some non-Node event target such as XHR object?
Chris Dumez
Comment 3 2016-02-15 12:09:04 PST
Chris Dumez
Comment 4 2016-02-15 12:09:52 PST
Comment on attachment 271353 [details] Patch Clearing flags on attachment: 271353 Committed r196588: <http://trac.webkit.org/changeset/196588>
Chris Dumez
Comment 5 2016-02-15 12:09:57 PST
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 6 2016-02-15 12:14:04 PST
(In reply to comment #2) > Comment on attachment 271346 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=271346&action=review > > > LayoutTests/fast/dom/Window/addEventListener-implicit-this.html:23 > > +bodyDispatchEventFunction = document.body.dispatchEvent; > > +shouldBeTrue("bodyDispatchEventFunction.call(undefined, new Event('myevent'))"); > > Why don't we try some non-Node event target such as XHR object? I added coverage for XHR before landing and checks that the test behaves the same in Chrome and Firefox.
Note You need to log in before you can comment on or make changes to this bug.