Bug 1556363 - Part 1: Check disabled state for submission in a common place; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D129048
This commit is contained in:
Edgar Chen
2021-10-25 20:43:10 +00:00
parent e59cb4491e
commit 635069f699
5 changed files with 8 additions and 21 deletions

View File

@@ -1021,10 +1021,13 @@ nsresult HTMLFormElement::ConstructEntryList(FormData* aFormData) {
// Walk the list of nodes and call SubmitNamesValues() on the controls
//
for (uint32_t i = 0; i < len; ++i) {
nsCOMPtr<nsIFormControl> fc = do_QueryInterface(sortedControls[i]);
MOZ_ASSERT(fc);
// Tell the control to submit its name/value pairs to the submission
fc->SubmitNamesValues(aFormData);
// Disabled elements don't submit
if (!sortedControls[i]->IsDisabled()) {
nsCOMPtr<nsIFormControl> fc = do_QueryInterface(sortedControls[i]);
MOZ_ASSERT(fc);
// Tell the control to submit its name/value pairs to the submission
fc->SubmitNamesValues(aFormData);
}
}
FormDataEventInit init;