This is spun off from bug 598482 so we can land part 24 of that without all the other bits.
Created attachment 586995 [details] [diff] [review] Flush on every mousemove, because otherwise we can end up with mouse events (mousemove, mousein, mouseout) dispatched to the wrong elements.
This caused about a 5% Tdhtml MozAfterPaint regression. It seems to all be concentrated in the layers1 (57% regression) and scrolling (120% regression) tests. Are we dispatching the synthetic mousemoves sync and triggering flushes on those or something? If so, would it make sense to not flush on synthetic mousemoves, if we can detect them here?
Can we dispatch synthetic mousemoves after we've flushed in the refresh driver, or something like that? I'd actually like to dispatch mousemoves in the refresh driver too, to help reduce flushing.
Hmm. That might be doable, yes. I just pushed a patch to that effect to try; if it pans out I'll ask for review in a followup bug.