Bug 1518442 - Part 2: Implement Event-based form participation; r=smaug,edgar

For Event-based form participation specification PR:
https://github.com/whatwg/html/pull/4239

Differential Revision: https://phabricator.services.mozilla.com/D43986
This commit is contained in:
John Dai
2019-09-09 13:53:27 +00:00
parent a795993772
commit edce529109
6 changed files with 156 additions and 74 deletions

View File

@@ -9,7 +9,6 @@
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLFormSubmission.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIForm.h"
@@ -33,6 +32,7 @@ class EventChainPreVisitor;
namespace dom {
class HTMLFormControlsCollection;
class HTMLImageElement;
class FormData;
class HTMLFormElement final : public nsGenericHTMLElement,
public nsIWebProgressListener,
@@ -277,12 +277,13 @@ class HTMLFormElement final : public nsGenericHTMLElement,
bool SubmissionCanProceed(Element* aSubmitter);
/**
* Walk over the form elements and call SubmitNamesValues() on them to get
* their data pumped into the FormSubmitter.
* Contruct the entry list to get their data pumped into the FormData and
* fire a `formdata` event with the entry list in formData attribute.
* <https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set>
*
* @param aFormSubmission the form submission object
* @param aFormData the form data object
*/
nsresult WalkFormElements(HTMLFormSubmission* aFormSubmission);
nsresult ConstructEntryList(FormData* aFormData);
/**
* Whether the submission of this form has been ever prevented because of
@@ -611,8 +612,11 @@ class HTMLFormElement final : public nsGenericHTMLElement,
* being invalid.
*/
bool mEverTriedInvalidSubmit;
/** Whether we are constructing entry list */
bool mIsConstructingEntryList;
private:
NotNull<const Encoding*> GetSubmitEncoding();
~HTMLFormElement();
};