Patch here.
While scrolling via trackpad or mousewheel, we currently send mouse position updates every 100ms. On pages with heavy mouse handlers or :hover styles, this can cause significant amounts of scroll jank.
Sending a mouse position update includes updating :hover styles, and dispatching mousemove, mouseover, mouseenter, mouseleave, and mouseout events.
We’re planning to stop sending mouse position updates while scrolling. This aligns more closely with the behavior of Internet Explorer, Firefox, and Safari. 100ms after a scroll ends, we’ll send the mouse position update.
- Internet Explorer: Sends events / updates :hover only when the mouse actually moves, with a few exceptions for compatibility reasons. [1]
- Firefox: Sends events / updates :hover after 100ms without any scrolling, but doesn’t dispatch mousemove events unless the mouse actually moves.
- Safari: Recently switched to only sending events / updating :hover after 100ms without scrolling.
There is some chance of this breaking websites, but since it aligns us more closely with other browsers, and provides a significant performance win, we believe it’s worthwhile. This change does not involve modifying any APIs or specified behavior.
[1] According to a PM on the IE team here.
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+...@chromium.org.
This is awesome and will make life a lot easier for web developers.
Thanks for doing this Tim!
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Rick, I think you're right that in the worst case, this will just lead to some sub-par user experience.
For an example of where this changes behavior, take a look at this demo, based on the jQuery UI tooltip demo. Previously, if you scrolled with the trackpad or mousewheel, the tooltip would stick to your cursor. Now the tooltip will only move once the scroll is over.
Well, I never said the browser would support continuous animation, only that in my application I'm listening for "mouse enters DOM item in list -> my own smooth animation plays". Without mouse events firing, I guess I'll have to do my own hit-detection on scroll to see if the mouse enters or exits an element and call the event handler that the other mouse events are bound to? It feels weird that I should have to redo all this stuff browsers already do.