Bug 1366361 - Part 1: .action/formAction should return the document's URL if @action/formaction is missing or empty. r=smaug
MozReview-Commit-ID: H4CK0SVpaCv
This commit is contained in:
@@ -1585,6 +1585,27 @@ HTMLFormElement::FlushPendingSubmission()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HTMLFormElement::GetAction(nsString& aValue)
|
||||
{
|
||||
if (!GetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue) ||
|
||||
aValue.IsEmpty()) {
|
||||
nsIDocument* document = OwnerDoc();
|
||||
nsIURI* docURI = document->GetDocumentURI();
|
||||
if (docURI) {
|
||||
nsAutoCString spec;
|
||||
nsresult rv = docURI->GetSpec(spec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(spec, aValue);
|
||||
}
|
||||
} else {
|
||||
GetURIAttr(nsGkAtoms::action, nullptr, aValue);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::GetActionURL(nsIURI** aActionURL,
|
||||
nsIContent* aOriginatingElement)
|
||||
|
||||
Reference in New Issue
Block a user