Detect whether we are currently blocking a user-initiated interaction

RESOLVED FIXED in Firefox 45

Status

()

Toolkit
Performance Monitoring
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Yoric, Assigned: Yoric)

Tracking

unspecified
mozilla45
Points:
---

Firefox Tracking Flags

(firefox45 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

This, with bug 1219145, would let us decrease further false positives.
Boris, I know that we can detect whether an event is user-initiated. Can you point me towards the code that does that?
Flags: needinfo?(bzbarsky)
EventStateManager::IsHandlingUserInput(), perhaps?

And a scriptable API at http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#1670
Flags: needinfo?(bzbarsky)
`EventStateManager::IsHandlingUserInput()` looks like a good candidate, indeed. It does cause a call the the clock, so we don't want to call it too often, though.

If we are willing to accept a few more false positives, `static int32_t EventStateManager::sUserInputEventDepth` could provide a good approximation, except in case of nested event loops.
Created attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r?smaug

To detect slow behaviors, it is useful to find out whether a user
input was handled between two instants.

This patch introduces EventStateManager::UserInputCount, which lets
client code determine whether user input was handled between two
points of execution, and EventStateManager::LatestUserInputStart,
which lets client code find out when the altest user input was
handled.
Attachment #8694720 - Flags: review?(bugs)

Comment 5

2 years ago
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

Now I'm lost... didn't I review this for Bug 1186491
Attachment #8694720 - Flags: review?(bugs)
Sorry, I must have made a mistake with MozReview. This is the right bug.
Attachment #8694720 - Attachment description: MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r?smaug → MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26841/diff/1-2/
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

https://reviewboard.mozilla.org/r/26841/#review24427

Accidentally reviewed as part of bug 1186491.
Attachment #8694720 - Flags: review+
Keywords: checkin-needed
Assignee: nobody → dteller

Comment 10

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/badf9e19d881
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.