W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2010

scroll event's target

From: Jacob Rossi <jrossi@microsoft.com>
Date: Fri, 29 Oct 2010 22:02:06 +0000
To: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <D0BC8E77E79D9846B61A2432D1BA4EAE023DFFDB@TK5EX14MBXC114.redmond.corp.microsoft.com>
The spec is unclear to me as to what the target should be for scroll events that result from the window being scrolled. It seems to me that we should fire the event on the default view (window). However, implementations seem to disagree.

The spec says "A user agent must dispatch this event when a document view or an element has been scrolled."

Shouldn't "document view" be "default view?" And in that case, then, shouldn't the target be the default View (window)?

Test case:
window.onload = function(){
document.body.style.height = '10000px'
window.addEventListener('scroll', function (e) { alert((e.target == window && e.eventPhase == Event.AT_TARGET)  ? 'passed' : 'failed'); }, true)
window.scrollTo(0, 1)

Received on Friday, 29 October 2010 22:02:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:16 UTC