Including visibility in the hysteresis mechanism has the effect of prolonging the visually idle timeout, and causing the page hide event to be run at foreground priority. Neither of these are particularly desirable. Instead separate visibility from the rest of the page activities we track (and apply hysteresis to), and feed this directly into determination of the UserActivity state.
Created attachment 238205 [details]
Comment on attachment 238205 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=238205&action=review
> + // Allow throttling if there is no page activity, and the page is viibly idle.
> + Waiting,
I wonder if "Waiting" would be clearer if it said what it was waiting for. Maybe "WaitingToStop" or "WillStop" "WillStopAfterDelay" or "WillStopSoon".
Committed revision 173693.