Backed out 4 changesets (bug 1743329) for causing failures at browser_popupNotification_security_delay.js. CLOSED TREE

Backed out changeset 6d33ea38cd14 (bug 1743329)
Backed out changeset 0f9bffa357a5 (bug 1743329)
Backed out changeset cd96c48488eb (bug 1743329)
Backed out changeset 209a41c449e1 (bug 1743329)
This commit is contained in:
Butkovits Atila
2024-05-29 15:47:23 +03:00
parent 74e0e80e31
commit 3a56b9800d
10 changed files with 31 additions and 109 deletions

View File

@@ -8692,19 +8692,15 @@ void PresShell::EventHandler::MaybeHandleKeyboardEventBeforeDispatch(
}
}
if (XRE_IsParentProcess() &&
!mPresShell->mIsLastChromeOnlyEscapeKeyConsumed) {
if (PointerLockManager::GetLockedRemoteTarget() ||
PointerLockManager::IsLocked()) {
// XXX See above comment to understand the reason why this needs
// to claim that the Escape key event is consumed by content
// even though it will be dispatched only into chrome.
aKeyboardEvent->PreventDefaultBeforeDispatch(
CrossProcessForwarding::eStop);
aKeyboardEvent->mFlags.mOnlyChromeDispatch = true;
if (aKeyboardEvent->mMessage == eKeyUp) {
PointerLockManager::Unlock();
}
nsCOMPtr<Document> pointerLockedDoc = PointerLockManager::GetLockedDocument();
if (!mPresShell->mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
// XXX See above comment to understand the reason why this needs
// to claim that the Escape key event is consumed by content
// even though it will be dispatched only into chrome.
aKeyboardEvent->PreventDefaultBeforeDispatch(CrossProcessForwarding::eStop);
aKeyboardEvent->mFlags.mOnlyChromeDispatch = true;
if (aKeyboardEvent->mMessage == eKeyUp) {
PointerLockManager::Unlock();
}
}
}