Why doesn't the scroll event bubble?

Today I have a theoretical question. Why doesn't the scroll event bubble? Is this related to performance issues? I did a digging, but, unfortunately, I did not find answers that would satisfy my curiosity.

Thank you for your responses:)

+6
source share
1 answer

It bubbles, but not on the elements. It bubbles on the document object before document.defaultView (document window). This behavior occurs to avoid performance problems (scroll events can fire at high speed).

If you want to know more about scrolling, I would suggest reading the W3 documentation:

https://www.w3.org/TR/cssom-view/#scrolling

Hope this helps.

+4
source

Source: https://habr.com/ru/post/956936/


All Articles