Bug 1279860 - part 3 - HTMLFormSubmission::GetFromForm, r=smaug

This commit is contained in:
Andrea Marchesini 2016-06-16 08:25:48 +01:00
parent aa5c829338
commit 6f89091771
3 changed files with 19 additions and 16 deletions

View File

@ -709,7 +709,8 @@ HTMLFormElement::BuildSubmission(HTMLFormSubmission** aFormSubmission,
//
// Get the submission object
//
rv = GetSubmissionFromForm(this, originatingElement, aFormSubmission);
rv = HTMLFormSubmission::GetFromForm(this, originatingElement,
aFormSubmission);
NS_ENSURE_SUBMIT_SUCCESS(rv);
//

View File

@ -812,10 +812,10 @@ GetEnumAttr(nsGenericHTMLElement* aContent,
} // anonymous namespace
nsresult
GetSubmissionFromForm(nsGenericHTMLElement* aForm,
nsGenericHTMLElement* aOriginatingElement,
HTMLFormSubmission** aFormSubmission)
/* static */ nsresult
HTMLFormSubmission::GetFromForm(nsGenericHTMLElement* aForm,
nsGenericHTMLElement* aOriginatingElement,
HTMLFormSubmission** aFormSubmission)
{
// Get all the information necessary to encode the form data
NS_ASSERTION(aForm->GetComposedDoc(),

View File

@ -30,6 +30,19 @@ class Blob;
class HTMLFormSubmission
{
public:
/**
* Get a submission object based on attributes in the form (ENCTYPE and
* METHOD)
*
* @param aForm the form to get a submission object based on
* @param aOriginatingElement the originating element (can be null)
* @param aFormSubmission the form submission object (out param)
*/
static nsresult
GetFromForm(nsGenericHTMLElement* aForm,
nsGenericHTMLElement* aOriginatingElement,
HTMLFormSubmission** aFormSubmission);
virtual ~HTMLFormSubmission()
{
MOZ_COUNT_DTOR(HTMLFormSubmission);
@ -212,17 +225,6 @@ private:
uint64_t mTotalLength;
};
/**
* Get a submission object based on attributes in the form (ENCTYPE and METHOD)
*
* @param aForm the form to get a submission object based on
* @param aOriginatingElement the originating element (can be null)
* @param aFormSubmission the form submission object (out param)
*/
nsresult GetSubmissionFromForm(nsGenericHTMLElement* aForm,
nsGenericHTMLElement* aOriginatingElement,
HTMLFormSubmission** aFormSubmission);
} // namespace dom
} // namespace mozilla