Closed
Bug 798298
Opened 13 years ago
Closed 13 years ago
Allow chrome JS code to know if it is being called as a result of a user input event
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox18 | --- | fixed |
People
(Reporter: mounir, Assigned: mounir)
References
Details
Attachments
(1 file)
|
6.42 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Currently, there are two ways to make sure some features are called when there is a real user action that might have requested it:
- the popup manager (in nsPIDOMWindow and nsGlobalWindow);
- nsEventStateManager::IsHandlingUserInput().
None of them (AFAIK) are available to JS but bug 794407 and bug 769569 needs a mechanism or the other to make sure those features are not abused.
I think we should expose something trough a component.
| Assignee | ||
Comment 1•13 years ago
|
||
Attachment #668475 -
Flags: review?(bugs)
Comment 2•13 years ago
|
||
Comment on attachment 668475 [details] [diff] [review]
Patch
>+ *aHandlingUserInput = GetPresContext()->EventStateManager()->IsHandlingUserInput();
GetPresContext() needs null check.
>+ /**
>+ * Returns if the current code is runned from a user input handling.
returns what?
And 'is run'
But perhaps:
Returns true if user input is being handled.
>+ *
>+ * This is calling nsEventStateManager::IsHandlingUserInput().
This calls nsEventStateManager::IsHandlingUserInput()
>+ */
>+ readonly attribute boolean handlingUserInput;
isHandlingUserInput
Attachment #668475 -
Flags: review?(bugs) → review+
Updated•13 years ago
|
blocking-basecamp: ? → +
| Assignee | ||
Comment 3•13 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla19
Comment 4•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Couldn't the homescreen app simply not display itself? I.e. it's the homescreen app which is listing all the apps, it can simply choose to not skip displaying anything when it sees its own manifestURL
| Assignee | ||
Comment 6•13 years ago
|
||
Jonas, I guess you meant to comment in bug 794407.
Yes. Thanks!
| Assignee | ||
Comment 8•13 years ago
|
||
Pushed in mozilla-aurora, because it is blocking basecamp.
https://hg.mozilla.org/releases/mozilla-aurora/rev/cc22c3a6f9ed
status-firefox18:
--- → fixed
Target Milestone: mozilla19 → mozilla18
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•