зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1360441 - Disable the IsHandlingUserInput timeout for execCommand(copy/cut) commands, r=ehsan
MozReview-Commit-ID: 341K1DEsVCg
This commit is contained in:
Родитель
89f6d51919
Коммит
0700aeac13
|
@ -7176,9 +7176,22 @@ nsContentUtils::IsFullScreenApiEnabled()
|
|||
bool
|
||||
nsContentUtils::IsRequestFullScreenAllowed(CallerType aCallerType)
|
||||
{
|
||||
return !sTrustedFullScreenOnly ||
|
||||
EventStateManager::IsHandlingUserInput() ||
|
||||
aCallerType == CallerType::System;
|
||||
// If more time has elapsed since the user input than is specified by the
|
||||
// dom.event.handling-user-input-time-limit pref (default 1 second), this
|
||||
// function also returns false.
|
||||
|
||||
if (!sTrustedFullScreenOnly || aCallerType == CallerType::System) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (EventStateManager::IsHandlingUserInput()) {
|
||||
TimeDuration timeout = HandlingUserInputTimeout();
|
||||
return timeout <= TimeDuration(0) ||
|
||||
(TimeStamp::Now() -
|
||||
EventStateManager::GetHandlingInputStart()) <= timeout;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -3868,13 +3868,7 @@ public:
|
|||
/*static*/ bool
|
||||
EventStateManager::IsHandlingUserInput()
|
||||
{
|
||||
if (sUserInputEventDepth <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TimeDuration timeout = nsContentUtils::HandlingUserInputTimeout();
|
||||
return timeout <= TimeDuration(0) ||
|
||||
(TimeStamp::Now() - sHandlingInputStart) <= timeout;
|
||||
return sUserInputEventDepth > 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -215,15 +215,16 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
static TimeStamp GetHandlingInputStart() {
|
||||
return sHandlingInputStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current code is being executed as a result of
|
||||
* user input. This includes anything that is initiated by user,
|
||||
* with the exception of page load events or mouse over events. If
|
||||
* this method is called from asynchronously executed code, such as
|
||||
* during layout reflows, it will return false. If more time has
|
||||
* elapsed since the user input than is specified by the
|
||||
* dom.event.handling-user-input-time-limit pref (default 1 second),
|
||||
* this function also returns false.
|
||||
* during layout reflows, it will return false.
|
||||
*/
|
||||
static bool IsHandlingUserInput();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче