зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1703472 - For window.focus, popup abuse level should be checked on the caller. r=smaug,hsivonen
Just like how for window.open() it's checked on the opener, of course. Note that when sending the focus request via IPC, we trust the check done on the child (bug 1677899). Do we have a good test to extend to cover this case? Differential Revision: https://phabricator.services.mozilla.com/D111107
This commit is contained in:
Родитель
77b6b45811
Коммит
4401eff8fe
|
@ -2213,8 +2213,10 @@ std::tuple<bool, bool> BrowsingContext::CanFocusCheck(CallerType aCallerType) {
|
|||
bool canFocus = aCallerType == CallerType::System ||
|
||||
!Preferences::GetBool("dom.disable_window_flip", true);
|
||||
if (!canFocus && openerBC == callerBC) {
|
||||
canFocus = (RevisePopupAbuseLevel(PopupBlocker::GetPopupControlState()) <
|
||||
PopupBlocker::openBlocked);
|
||||
canFocus =
|
||||
(callerBC ? callerBC : this)
|
||||
->RevisePopupAbuseLevel(PopupBlocker::GetPopupControlState()) <
|
||||
PopupBlocker::openBlocked;
|
||||
}
|
||||
|
||||
bool isActive = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче