Closed smaug---- closed 2 years ago
Oh that's a typo, isTrusted should be true. Before I send a PR to change this, does the rationale for that make sense to you? We don't want to count scrolls performed by the website itself, only scrolls performed by the user.
scroll events aren't something which occur only because of user interaction. Scroll events tell that something scrollable has been scrolled, it can be because of user using wheel, or scrollbar, or keyboard or touch, or it can happen because of use of some API. So the flag wouldn't answer to the question of "only scrolls performed by the user."
Oh, my bad. Any scroll forced by the use of an API such as window.scroll() would produce a trusted scroll event. So we do want to exclude those as well - any thoughts on whether there is language we can use here? Re isTrusted
, we do want to exclude events where isTrusted
is false as those can be created and dispatched by the developer at will. But that's not sufficient here since we want to also exclude some scrolls that are trusted...
So we'd need some flag to tell when user interaction caused some scrolling. Actual scroll event is dispatched way later.
What all is counted as user interaction causing scrolling? What if there is <div onmousemove='setTimeout(function_which_triggers_scroll)'>move mouse over me</div>
.
Perhaps I don't quite understand the reasoning around scrolling being special. Why for example using wheel to zoom a map isn't treated the same way?
Oh yea I agree that should stop the algorithm too, seems that the spec is just not covering this properly. What about this: we keep a flag that is set when the user performs some interaction which will trigger an event which is not one of mouseMove, mouseEnter, mouseLeave, the touch/pointer counterparts of those, and keyUp.
enter/leave are triggered by move, so not sure those need to be listed.
I don't quite understand why keyup is special.
A keyup is special because it may be dispatched to a page that was reloaded via Ctrl+R, for example.
The original issue appears to have been fixed (#103)
I think the remainder of the issues are being / can be covered by #105
The spec has "If target’s relevant global object is a Window object, event’s type is scroll and its isTrusted is false, set target’s relevant global object's has dispatched scroll event to true."