Bug 1453517 - Consolidate popup permission checks to nsContentUtils; r=bz
Permissions checks for popups were happening in nsIPopupWindowManager, but that really only required a pref and perm check. The XPCOM machinery around this isn't really needed, and the check was only called from two places in content, so this fits in nsContentUtils. MozReview-Commit-ID: 9x60x1BKWcr
This commit is contained in:
@@ -695,14 +695,7 @@ HTMLInputElement::IsPopupBlocked() const
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPopupWindowManager> pm = do_GetService(NS_POPUPWINDOWMANAGER_CONTRACTID);
|
||||
if (!pm) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t permission;
|
||||
pm->TestPermission(OwnerDoc()->NodePrincipal(), &permission);
|
||||
return permission == nsIPopupWindowManager::DENY_POPUP;
|
||||
return !nsContentUtils::CanShowPopup(OwnerDoc()->NodePrincipal());
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
||||
Reference in New Issue
Block a user