summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-21 10:32:47 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-21 10:32:47 +0000
commit98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d (patch)
tree5d194dc3e53b4f5a4fa6b31b7756bf426fbe3cb9 /dom
parent2b6effbf29cb4f7aa85e4f697c79c473cc4c9ea4 (diff)
downloadUXP-98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d.tar
UXP-98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d.tar.gz
UXP-98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d.tar.lz
UXP-98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d.tar.xz
UXP-98f6ad61f4f3c66209036db4bc7a4ae6ff4d1d3d.zip
[widget] Require user interaction when picking files or folders v2
Now with extra sauce to make it work cross-platform and cross-versions and for HTML input elements only.
Diffstat (limited to 'dom')
-rw-r--r--dom/html/HTMLInputElement.cpp2
-rw-r--r--dom/ipc/FilePickerParent.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index 86d03d8f5..557e673e1 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -866,7 +866,7 @@ HTMLInputElement::InitFilePicker(FilePickerType aType)
mode = static_cast<int16_t>(nsIFilePicker::modeOpen);
}
- nsresult rv = filePicker->Init(win, title, mode);
+ nsresult rv = filePicker->Init(win, title, mode, /*aRequireInteraction = */ true);
NS_ENSURE_SUCCESS(rv, rv);
if (!okButtonLabel.IsEmpty()) {
diff --git a/dom/ipc/FilePickerParent.cpp b/dom/ipc/FilePickerParent.cpp
index 3e8301f24..1438e374f 100644
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -248,7 +248,8 @@ FilePickerParent::CreateFilePicker()
return false;
}
- return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode));
+ return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode,
+ element->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)));
}
bool