Scrollend fires on keyboard scrolls that don't change scroll position
Categories
(Core :: Layout: Scrolling and Overflow, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | verified |
People
(Reporter: awogbemila, Assigned: dlrobertson)
References
Details
Attachments
(2 files)
Steps to reproduce:
Please view this codepen: https://codepen.io/awogbemila/pen/zYmrRVV
The div should be scrolled all the way up (scrollTop is 0).
Press and release the up arrow key
Observe that scrollend is fired even though no scrolling happened (scrollend count is incremented).
You can also scroll the div all the way down and then press and release arrow down.
You'll see that scrollend is fired even though no scrolling happened.
Actual results:
Scrollend events fire to the div even though the div does not actually scroll (scrollTop does not change).
Expected results:
Scrollend events should not fire since there was no scrolling as this working group spec notes[1].
Also note that firefox behaves differently with mouse wheels: when no scrolling happens, it does not fire scrollend which I believe is the correct behavior.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Scrolling and Overflow' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 2•2 years ago
|
||
Good catch! On mac I don't see this, but I don't see scrollend events fired for keyboard scrolls that should fire scrollend events. What OS did you see this on?
Comment 3•2 years ago
|
||
I am able to see the events on Linux. The events come from here in nsHTMLScrollFrame::SetTransformingByAPZ.
Reporter | ||
Comment 4•2 years ago
|
||
Hmm, originally I saw this running firefox on Linux but I've tried it on mac as well and I see it there too.
On a somewhat related note: this issue will affect a wpt: https://wpt.fyi/results/dom/events/scrolling/scrollend-event-not-fired-on-no-scroll.html?label=master&label=experimental&aligned&q=scrollend which tests this use case though it is currently masked by another issue which I filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1827912 for.
Comment 5•2 years ago
|
||
I can reproduce this on Linux as well.
(In reply to Dan Robertson (:dlrobertson) from comment #2)
On mac I [...] don't see scrollend events fired for keyboard scrolls that should fire scrollend events.
That might be worth filing an additional bug about for tracking purposes.
Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
I’m testing in Firefox Nightly on macOS.
When I click the scroll container and then press and hold down the Space bar, the scrollend counter keeps increasing indefinitely, even after the end of the scroll container was reached.
In Chrome, the scrollend counter increases by 2. I guess the logic is, one for pressing Space bar, and another one for holding it down.
Assignee | ||
Comment 7•2 years ago
|
||
When a APZC handles a keyboard scroll or other smooth scroll,
no scrollend event should be fired if the scroll position will not
change as a result of the scroll.
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
Add scrollend event tests for keyboard scrolls.
Depends on D187050
Comment 10•2 years ago
|
||
Backed out for causing mochitests failures in test_group_scrollend.html.
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | gfx/layers/apz/test/mochitest/test_group_scrollend.html | Error: Native key events not supported on platform linux
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
Backed out with Bug 1831580 for causing scrollend failures.
Assignee | ||
Comment 14•2 years ago
|
||
Fixed and running some more tests on try. I should have caught the scrollend tests in wpt that we now pass.
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
Backed out for causing mochitest failures at gfx/layers/apz/test/mochitest/test_group_scrollend.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/183b1ebcb4ab0497430f16896bf7b69b2fbb5684
Assignee | ||
Comment 17•2 years ago
|
||
The failing test will be fixed by scroll position rounding, but perhaps we should put in place a workaround of some kind.
Comment 18•2 years ago
|
||
Comment 19•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dab9c40ca808
https://hg.mozilla.org/mozilla-central/rev/c02a1959f381
Updated•2 years ago
|
Comment 20•1 years ago
|
||
Reproduced the issue with Firefox 114.0a1 (2023-04-13) on Windows 10x64. Pressing the UP arrow keyboard key on the test codepen from comment 0 will increase the scrolled count.
The issue is verified fixed with Firefox 121.0b3 on Windows 10x64, macOS 12 and Ubuntu 22. The scrolled count is no longer increased after following STR from comment 0.
Description
•