Bug 1586220 - still treat shortcut/modifier keypresses as interaction for the purposes of GCs/timers and so on, just not for the website, r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D48623

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-10-09 10:39:41 +00:00
Родитель 4c4528501d
Коммит f885567a48
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -487,8 +487,7 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
aEvent->mClass == eWheelEventClass ||
aEvent->mClass == ePointerEventClass ||
aEvent->mClass == eTouchEventClass ||
(aEvent->mClass == eKeyboardEventClass &&
IsKeyboardEventUserActivity(aEvent)) ||
aEvent->mClass == eKeyboardEventClass ||
(aEvent->mClass == eDragEventClass && aEvent->mMessage == eDrop) ||
IsMessageGamepadUserActivity(aEvent->mMessage))) {
if (gMouseOrKeyboardEventCounter == 0) {
@ -502,9 +501,11 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
++gMouseOrKeyboardEventCounter;
nsCOMPtr<nsINode> node = aTargetContent;
if (node && (aEvent->mMessage == eKeyUp || aEvent->mMessage == eMouseUp ||
aEvent->mMessage == eWheel || aEvent->mMessage == eTouchEnd ||
aEvent->mMessage == ePointerUp || aEvent->mMessage == eDrop)) {
if (node &&
((aEvent->mMessage == eKeyUp && IsKeyboardEventUserActivity(aEvent)) ||
aEvent->mMessage == eMouseUp || aEvent->mMessage == eWheel ||
aEvent->mMessage == eTouchEnd || aEvent->mMessage == ePointerUp ||
aEvent->mMessage == eDrop)) {
Document* doc = node->OwnerDoc();
while (doc) {
doc->SetUserHasInteracted();