Currently, we don't schedule a BeginMainFrame until after we're done processing keyboard input.
https://output.jsbin.com/rofajo adds a keydown listener which waits 1 second.
If I hit the down key twice, I wait 2 seconds, and then the page scrolls down.
I expect the page to scroll down after 1 second, and then scroll down further after another second.
In this example:
1. user presses ↓ key
2. RenderView gets input event, starts JS listener with 1000ms busy loop
... ~500ms later ...
3. user presses ↓ key again
... ~500ms later ...
4. first input task completes
5. second input task (from #3) begins
... 1000 ms later ...
6. second input task completes
7. cc::ProxyMain::BeginMainFrame runs, starting the scroll animation
We'd like to schedule a BeginMainFrame before #2, so that it runs between #2 and #3.
See sketch of patch here:
https://codereview.chromium.org/2545423002
This is currently blocked on having better keyboard latency metrics.
Comment 1 by altimin@chromium.org
, Aug 15