Bug 639490 - Remove nsHTMLInputElement::GetNameIfExists. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Wed, 04 May 2011 14:46:09 +0200
changeset 68976 a015d76bf4d9af486827b25e4dd21ae980063f5d
parent 68975 f68a9bfc9bfdc68ff1f0133cae708ece83b608ee
child 68977 eabc4dc89606144086b5e2c5e5510d99d03d6034
push id19817
push userbzbarsky@mozilla.com
push dateWed, 04 May 2011 18:55:02 +0000
treeherdermozilla-central@8d603861d0aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs639490
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 639490 - Remove nsHTMLInputElement::GetNameIfExists. r=sicking
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/src/nsHTMLInputElement.h
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -2997,17 +2997,17 @@ nsHTMLInputElement::SubmitNamesValues(ns
        aFormSubmission->GetOriginatingElement() != this) ||
       ((mType == NS_FORM_INPUT_RADIO || mType == NS_FORM_INPUT_CHECKBOX) &&
        !GetChecked())) {
     return NS_OK;
   }
 
   // Get the name
   nsAutoString name;
-  PRBool nameThere = GetNameIfExists(name);
+  GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
 
   // Submit .x, .y for input type=image
   if (mType == NS_FORM_INPUT_IMAGE) {
     // Get a property set by the frame to find out where it was clicked.
     nsIntPoint* lastClickedPoint =
       static_cast<nsIntPoint*>(GetProperty(nsGkAtoms::imageClickedPoint));
     PRInt32 x, y;
     if (lastClickedPoint) {
@@ -3035,17 +3035,17 @@ nsHTMLInputElement::SubmitNamesValues(ns
     return NS_OK;
   }
 
   //
   // Submit name=value
   //
 
   // If name not there, don't submit
-  if (!nameThere) {
+  if (name.IsEmpty()) {
     return NS_OK;
   }
 
   // Get the value
   nsAutoString value;
   rv = GetValue(value);
   if (NS_FAILED(rv)) {
     return rv;
--- a/content/html/content/src/nsHTMLInputElement.h
+++ b/content/html/content/src/nsHTMLInputElement.h
@@ -383,26 +383,16 @@ protected:
   }
 
   nsresult SetIndeterminateInternal(PRBool aValue,
                                     PRBool aShouldInvalidate);
 
   nsresult GetSelectionRange(PRInt32* aSelectionStart, PRInt32* aSelectionEnd);
 
   /**
-   * Get the name if it exists and return whether it did exist
-   * @param aName the name returned [OUT]
-   * @param true if the name is empty, false otherwise
-   */
-  PRBool GetNameIfExists(nsAString& aName) {
-    GetAttr(kNameSpaceID_None, nsGkAtoms::name, aName);
-    return !aName.IsEmpty();
-  }
-
-  /**
    * Called when an attribute is about to be changed
    */
   virtual nsresult BeforeSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                                  const nsAString* aValue, PRBool aNotify);
   /**
    * Called when an attribute has just been changed
    */
   virtual nsresult AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,