From 6525273de3f769d3c7906d7b1f499b28a88c54cd Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 1 Jun 2010 13:53:43 +1200 Subject: [PATCH] Backed out changeset 25c7d2e71e57 --- .../html/content/src/nsHTMLFormElement.cpp | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index fa885c04e35..38ee973d9d2 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -353,12 +353,28 @@ nsHTMLFormElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, } NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset) -NS_IMPL_STRING_ATTR(nsHTMLFormElement, Action, action) NS_IMPL_STRING_ATTR(nsHTMLFormElement, Enctype, enctype) NS_IMPL_STRING_ATTR(nsHTMLFormElement, Method, method) NS_IMPL_STRING_ATTR(nsHTMLFormElement, Name, name) NS_IMPL_STRING_ATTR(nsHTMLFormElement, Target, target) +NS_IMETHODIMP +nsHTMLFormElement::GetAction(nsAString& aValue) +{ + GetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue); + if (aValue.IsEmpty()) { + // Avoid resolving action="" to the base uri, bug 297761. + return NS_OK; + } + return GetURIAttr(nsGkAtoms::action, nsnull, aValue); +} + +NS_IMETHODIMP +nsHTMLFormElement::SetAction(const nsAString& aValue) +{ + return SetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue, PR_TRUE); +} + NS_IMETHODIMP nsHTMLFormElement::Submit() { @@ -1322,11 +1338,7 @@ nsHTMLFormElement::GetActionURL(nsIURI** aActionURL) // Grab the URL string // nsAutoString action; - GetAttr(kNameSpaceID_None, nsGkAtoms::action, action); - // Avoid resolving action="" to the base uri, bug 297761. - if (!action.IsEmpty()) { - GetURIAttr(nsGkAtoms::action, nsnull, action); - } + GetAction(action); // // Form the full action URL