Backed out changeset b21f364898eb (bug 1678389) for causing Android gv-unit failures CLOSED TREE
This commit is contained in:
@@ -661,15 +661,19 @@ nsColorPickerShownCallback::Done(const nsAString& aColor) {
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsColorPickerShownCallback, nsIColorPickerShownCallback)
|
||||
|
||||
static bool IsPopupBlocked(Document* aDoc) {
|
||||
if (aDoc->ConsumeTransientUserGestureActivation()) {
|
||||
return false;
|
||||
bool HTMLInputElement::IsPopupBlocked() const {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> win = OwnerDoc()->GetWindow();
|
||||
MOZ_ASSERT(win, "window should not be null");
|
||||
if (!win) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, "DOM"_ns, aDoc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"InputPickerBlockedNoUserActivation");
|
||||
return true;
|
||||
// Check if page can open a popup without abuse regardless of allowed events
|
||||
if (PopupBlocker::GetPopupControlState() <= PopupBlocker::openBlocked) {
|
||||
return !PopupBlocker::TryUsePopupOpeningToken(OwnerDoc()->NodePrincipal());
|
||||
}
|
||||
|
||||
return !PopupBlocker::CanShowPopupByPermission(OwnerDoc()->NodePrincipal());
|
||||
}
|
||||
|
||||
nsresult HTMLInputElement::InitColorPicker() {
|
||||
@@ -685,7 +689,7 @@ nsresult HTMLInputElement::InitColorPicker() {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (IsPopupBlocked(doc)) {
|
||||
if (IsPopupBlocked()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -730,7 +734,7 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (IsPopupBlocked(doc)) {
|
||||
if (IsPopupBlocked()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user