Idle callback deadline doesn't reduce when there's pending user input |
||||
Issue descriptionhttps://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/IdleDeadline.cpp?sq=package:chromium&rcl=1475695348&l=12 If you're using requestIdleCallback and the system tells you that the deadline is 50ms in the future, and then there's a user input (ex. a keystroke) we don't reduce the deadline time making timeRemaining return 0, so user code cannot early abort like the parser does with something like shouldYieldForHighPriorityWork(). While I think this does technically match rail with a maximum of 50ms delay, it could be better where idle work aborts immediately to handle user input so key strokes aren't delayed and future idle tasks can drop from long time (50ms) to short time (8ms).
,
Oct 6 2016
Hmm, I suppose we could make timeRemaining() check shouldYieldForHighPriorityWork() and return zero when needed.
,
Oct 6 2016
The spec certainly allows us to do this (I had it in the back of my head that it might be worth doing something like this when writing the spec). I'd be happy with us modifying timeRemaining() check shouldYieldForHighPriorityWork() and drop down to zero when there is a pending interaction.
,
Nov 17 2016
,
Nov 21 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c96e8e1003ed954a54110e0ec652e46ef7a962cb commit c96e8e1003ed954a54110e0ec652e46ef7a962cb Author: skyostil <skyostil@chromium.org> Date: Mon Nov 21 20:13:35 2016 requestIdleCallback: Yield for high priority work When a high priority task is pending (e.g., user input) while an idle callback is running, we should reduce the remaining idle period length to zero to signal the idle callback to exit. This can help reduce touch latency. BUG= 653352 Review-Url: https://codereview.chromium.org/2516493002 Cr-Commit-Position: refs/heads/master@{#433621} [modify] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/core/BUILD.gn [modify] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/core/dom/IdleDeadline.cpp [modify] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/core/dom/IdleDeadline.h [add] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp [modify] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp [modify] https://crrev.com/c96e8e1003ed954a54110e0ec652e46ef7a962cb/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
,
Nov 22 2016
|
||||
►
Sign in to add a comment |
||||
Comment 1 by dbeam@chromium.org
, Oct 6 2016