Closed Bug 1552473 Opened 6 years ago Closed 9 months ago

Scrolling an element with opacity: 0; does not fire "scroll" events

Categories

(Core :: Layout, defect, P3)

68 Branch
defect

Tracking

()

RESOLVED FIXED
Webcompat Priority P3
Tracking Status
firefox68 --- affected

People

(Reporter: denschub, Unassigned)

References

Details

Attachments

(2 files)

Attached file testcase.html

For the easiest possible explanation, see the attached testcase. There is a 10000x10000px div inside a viewport-filling container. On that div, there is an event listener for the scroll event. The 10k pixel container has opacity: 0;, so you won't see it, but it's still there.

Open a console, scroll around in the content, and observe the console. Nothing happens. If you try the same in Chrome, you'll notice that Chrome does indeed fire scroll events. Even more interesting: If you open the testcase in Fennec and try to scroll, you'll notice that Fennec does fire touchmove events, but no scroll events.

Now, as weird as this use case is, a site is actually using it to catch events for a sliding UI element. That works just fine in Chrome, but as we eat the scroll events, it breaks in Firefox.

I didn't find anything in the specs that would allow us to not dispatch scroll events on an transparent element, but I'm happy to be corrected. :)

Webcompat Priority: --- → ?

->layout which decides when to fire scroll events.

Component: DOM: Events → Layout
Attached file Testcase #2

Fwiw, if you use 'visibility: hidden' instead then Chrome also stops generating scroll events.

We do dispatch scroll events on the first testcase if you click and then press spacebar, or pageup/pagedown, or uparrow/downarrow.

It seems to be specifically mousewheel-scrolling (or equivalently, laptop-touchpad scrolling) that doesn't work -- so presumably those mousewheel events aren't making it through to the scrollable element.

Interestingly, with the first test case I can see scroll events on mouse wheel scrolling on my Linux box Ubuntu 18.04.

Priority: -- → P3
Webcompat Priority: ? → P3
Severity: normal → S3

This appears to be fixed - the testcase I attached is now dispatching scroll events.

Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: