Backout bug 566128 to fix test failures
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 01 Jun 2010 13:53:59 +1200
changeset 42979 2395929835f5fa8b9bff670f031c9e2a643b1ec5
parent 42977 5c06b06da1b34861210dfe74db97dae7482533cb (current diff)
parent 42978 dda87951d9944f7d1cf2c4b9c3f99cafb0bd8bf9 (diff)
child 42980 e0ead431e036974385635080b4e752e04d458cd1
push idunknown
push userunknown
push dateunknown
bugs566128
milestone1.9.3a5pre
Backout bug 566128 to fix test failures
content/html/content/src/nsHTMLFormElement.cpp
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -350,23 +350,39 @@ nsHTMLFormElement::SetAttr(PRInt32 aName
     ForgetCurrentSubmission();
     mNotifiedObservers = notifiedObservers;
   }
   return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
                                        aNotify);
 }
 
 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()
 {
   // Send the submit event
   nsresult rv = NS_OK;
   nsRefPtr<nsPresContext> presContext = GetPresContext();
   if (mPendingSubmission) {
     // aha, we have a pending submission that was not flushed
     // (this happens when form.submit() is called twice)
@@ -1319,21 +1335,17 @@ nsHTMLFormElement::GetActionURL(nsIURI**
   nsresult rv = NS_OK;
 
   *aActionURL = nsnull;
 
   //
   // 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
   //
 
   // Get the document to form the URL.
   // We'll also need it later to get the DOM window when notifying form submit
   // observers (bug 33203)