Safari 4 530.17 with WebKit-r44837 When you register an event listener on the window object, event.currentTarget and 'this' in the callback function should point to the window object. In Firefox, this is true. In Safari, 'this' points to the window, but event.currentTarget points to the document instead. In Opera, they both point to the document. Firefox's behavior makes the most sense to me. I asked for clarification at <http://lists.w3.org/Archives/Public/public-html/2009Jun/0566.html>. This affect the 'input' and 'change' events for example.
Created attachment 31604 [details] TC that uses the 'input' event
This is possible now that DOMWindow inherits from EventTarget. The fix should be in Node.cpp: 2487: event->setCurrentTarget(targetForWindowEvents->document()); // FIXME: targetForWindowEvents should be the event target. 2525: event->setCurrentTarget(targetForWindowEvents->document()); // FIXME: targetForWindowEvents should be the event target.
Created attachment 31619 [details] patch
Comment on attachment 31619 [details] patch Looks good.
Fixed in r44913.