mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 04:16:16 +00:00
Bug 555657 - GetSubmissionFromForm caches the wrong doc, r=sicking
This commit is contained in:
parent
7a93ecfc41
commit
5741f6929d
@ -803,8 +803,8 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
nsFormSubmission** aFormSubmission)
|
||||
{
|
||||
// Get all the information necessary to encode the form data
|
||||
nsIDocument* doc = aForm->GetCurrentDoc();
|
||||
NS_ASSERTION(doc, "Should have doc if we're building submission!");
|
||||
NS_ASSERTION(aForm->GetCurrentDoc(),
|
||||
"Should have doc if we're building submission!");
|
||||
|
||||
// Get encoding type (default: urlencoded)
|
||||
PRInt32 enctype = NS_FORM_ENCTYPE_URLENCODED;
|
||||
@ -826,16 +826,16 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
enctype == NS_FORM_ENCTYPE_TEXTPLAIN) {
|
||||
*aFormSubmission = new nsFSTextPlain(charset);
|
||||
} else {
|
||||
nsIDocument* doc = aForm->GetOwnerDoc();
|
||||
if (enctype == NS_FORM_ENCTYPE_MULTIPART ||
|
||||
enctype == NS_FORM_ENCTYPE_TEXTPLAIN) {
|
||||
nsAutoString enctypeStr;
|
||||
aForm->GetAttr(kNameSpaceID_None, nsGkAtoms::enctype, enctypeStr);
|
||||
const PRUnichar* enctypeStrPtr = enctypeStr.get();
|
||||
SendJSWarning(aForm->GetOwnerDoc(), "ForgotPostWarning",
|
||||
SendJSWarning(doc, "ForgotPostWarning",
|
||||
&enctypeStrPtr, 1);
|
||||
}
|
||||
*aFormSubmission = new nsFSURLEncoded(charset, method,
|
||||
aForm->GetOwnerDoc());
|
||||
*aFormSubmission = new nsFSURLEncoded(charset, method, doc);
|
||||
}
|
||||
NS_ENSURE_TRUE(*aFormSubmission, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user