Bug 635008 (2/4) - Remove dead code. r=bz a=hardblocker
authorMounir Lamouri <mounir.lamouri@gmail.com>
Fri, 25 Feb 2011 19:12:35 +0100
changeset 63106 f644c17d2120cb7469247298eed1cbe2d5cccdeb
parent 63105 10fe279c3613e9ee92f4a4081df5440638de1a0b
child 63107 7702940cf12cb41c8a963bb78e74aa34264db1fd
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersbz, hardblocker
bugs635008
milestone2.0b13pre
Bug 635008 (2/4) - Remove dead code. r=bz a=hardblocker
content/html/content/public/nsIRadioVisitor.h
content/html/content/src/nsHTMLInputElement.cpp
--- a/content/html/content/public/nsIRadioVisitor.h
+++ b/content/html/content/public/nsIRadioVisitor.h
@@ -94,28 +94,16 @@ NS_GetRadioSetCheckedChangedVisitor(PRBo
  * @param aExcludeElement the element 
  */
 nsresult
 NS_GetRadioGetCheckedChangedVisitor(PRBool* aCheckedChanged,
                                     nsIFormControl* aExcludeElement,
                                     nsIRadioVisitor** aVisitor);
 
 /**
- * This visitor will return (via aRequired) if an element of the group has the
- * required attribute set.
- *
- * @param aExcludeElement an element to exclude (for optimization purpose), can be null
- * @param aRequired       whether there is a radio in the group with the required attribute [OUT]
- * @return the visitor
- */
-nsIRadioVisitor*
-NS_GetRadioGroupRequiredVisitor(nsIFormControl* aExcludeElement,
-                                bool* aRequired);
-
-/**
  * This visitor will update the validity states of all radio in the group and
  * call ContentStatesChanged if needed.
  *
  * @param aExcludeElement an element to exclude (for optimization purpose), can be null
  * @param aDocument       the document owning the group
  * @param aNotify         whether we should call ContentStatesChanged
  * @return the visitor
  */
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -4276,44 +4276,16 @@ public:
     return NS_OK;
   }
 
 protected:
   PRBool* mCheckedChanged;
   nsIFormControl* mExcludeElement;
 };
 
-class nsRadioGroupRequiredVisitor : public nsRadioVisitor {
-public:
-  nsRadioGroupRequiredVisitor(nsIFormControl* aExcludeElement, bool* aRequired)
-    : mRequired(aRequired)
-    , mExcludeElement(aExcludeElement)
-    { }
-
-  NS_IMETHOD Visit(nsIFormControl* aRadio, PRBool* aStop)
-  {
-    if (aRadio == mExcludeElement) {
-      return NS_OK;
-    }
-
-    *mRequired = static_cast<nsHTMLInputElement*>(aRadio)
-      ->HasAttr(kNameSpaceID_None, nsGkAtoms::required);
-
-    if (*mRequired) {
-      *aStop = PR_TRUE;
-    }
-
-    return NS_OK;
-  }
-
-protected:
-  bool* mRequired;
-  nsIFormControl* mExcludeElement;
-};
-
 class nsRadioSetValueMissingState : public nsRadioVisitor {
 public:
   nsRadioSetValueMissingState(nsIFormControl* aExcludeElement,
                               nsIDocument* aDocument, bool aValidity,
                               bool aNotify)
     : mExcludeElement(aExcludeElement)
     , mDocument(aDocument)
     , mValidity(aValidity)
@@ -4425,23 +4397,16 @@ NS_GetRadioGetCheckedChangedVisitor(PRBo
  *
  * TODO:
  * Do we really need factories for radio visitors? Or at least, we should move
  * that somewhere else because it feels like it's here only because the radio
  * visitor classes are defined after most of nsHTMLInputElement code.
  * See bug 586298
  */
 nsIRadioVisitor*
-NS_GetRadioGroupRequiredVisitor(nsIFormControl* aExcludeElement,
-                                bool* aRequired)
-{
-  return new nsRadioGroupRequiredVisitor(aExcludeElement, aRequired);
-}
-
-nsIRadioVisitor*
 NS_SetRadioValueMissingState(nsIFormControl* aExcludeElement,
                              nsIDocument* aDocument,
                              bool aValidity, bool aNotify)
 {
   return new nsRadioSetValueMissingState(aExcludeElement, aDocument, aValidity,
                                          aNotify);
 }