Bug 589975 - NS_GetRadioUpdateValueMissingVisitor shouldn't have a aNotify parameter. r=sicking a=blocking-final

This commit is contained in:
Mounir Lamouri 2010-11-11 13:34:27 +01:00
Родитель 5a0aec7ce6
Коммит 6f7c45f58c
4 изменённых файлов: 12 добавлений и 16 удалений

Просмотреть файл

@ -102,6 +102,6 @@ NS_GetRadioGetCheckedChangedVisitor(PRBool* aCheckedChanged,
* value missing validity state.
*/
nsIRadioVisitor*
NS_GetRadioUpdateValueMissingVisitor(PRBool aNotify);
NS_GetRadioUpdateValueMissingVisitor();
#endif // nsIRadioVisitor_h___

Просмотреть файл

@ -1245,7 +1245,7 @@ nsHTMLFormElement::RemoveElement(nsGenericHTMLFormElement* aChild,
if (aChild->GetType() == NS_FORM_INPUT_RADIO) {
nsRefPtr<nsHTMLInputElement> radio =
static_cast<nsHTMLInputElement*>(aChild);
radio->WillRemoveFromRadioGroup(aNotify);
radio->WillRemoveFromRadioGroup();
}
// Determine whether to remove the child from the elements list

Просмотреть файл

@ -778,7 +778,7 @@ nsHTMLInputElement::BeforeSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
(aName == nsGkAtoms::type && !mForm)) &&
mType == NS_FORM_INPUT_RADIO &&
(mForm || !(GET_BOOLBIT(mBitField, BF_PARSER_CREATING)))) {
WillRemoveFromRadioGroup(aNotify);
WillRemoveFromRadioGroup();
} else if (aNotify && aName == nsGkAtoms::src &&
mType == NS_FORM_INPUT_IMAGE) {
if (aValue) {
@ -1685,7 +1685,7 @@ nsHTMLInputElement::SetCheckedInternal(PRBool aChecked, PRBool aNotify)
if (mType == NS_FORM_INPUT_RADIO) {
// OnValueChanged is going to be called for all radios in the radio group.
nsCOMPtr<nsIRadioVisitor> visitor =
NS_GetRadioUpdateValueMissingVisitor(aNotify);
NS_GetRadioUpdateValueMissingVisitor();
VisitGroup(visitor, aNotify);
}
}
@ -2518,7 +2518,7 @@ nsHTMLInputElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
// of the case where we're removing from the document and we don't
// have a form
if (!mForm && mType == NS_FORM_INPUT_RADIO) {
WillRemoveFromRadioGroup(PR_FALSE);
WillRemoveFromRadioGroup();
}
nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
@ -3414,7 +3414,7 @@ nsHTMLInputElement::AddedToRadioGroup(PRBool aNotify)
}
void
nsHTMLInputElement::WillRemoveFromRadioGroup(PRBool aNotify)
nsHTMLInputElement::WillRemoveFromRadioGroup()
{
//
// If the input element is not in a form and
@ -3447,7 +3447,7 @@ nsHTMLInputElement::WillRemoveFromRadioGroup(PRBool aNotify)
// Removing a checked radio from the group can change the validity state.
// Let's ask other radio to update their value missing validity state.
nsCOMPtr<nsIRadioVisitor> visitor =
NS_GetRadioUpdateValueMissingVisitor(aNotify);
NS_GetRadioUpdateValueMissingVisitor();
VisitGroup(visitor, PR_FALSE);
}
@ -4161,9 +4161,8 @@ protected:
class nsRadioUpdateValueMissingVisitor : public nsRadioVisitor {
public:
nsRadioUpdateValueMissingVisitor(PRBool aNotify)
nsRadioUpdateValueMissingVisitor()
: nsRadioVisitor()
, mNotify(aNotify)
{ }
virtual ~nsRadioUpdateValueMissingVisitor() { };
@ -4183,12 +4182,9 @@ public:
*/
nsCOMPtr<nsITextControlElement> textCtl(do_QueryInterface(aRadio));
NS_ASSERTION(textCtl, "Visit() passed a null or non-radio pointer");
textCtl->OnValueChanged(mNotify);
textCtl->OnValueChanged(PR_TRUE);
return NS_OK;
}
protected:
PRBool mNotify;
};
nsresult
@ -4272,9 +4268,9 @@ NS_GetRadioGetCheckedChangedVisitor(PRBool* aCheckedChanged,
* See bug 586298
*/
nsIRadioVisitor*
NS_GetRadioUpdateValueMissingVisitor(PRBool aNotify)
NS_GetRadioUpdateValueMissingVisitor()
{
return new nsRadioUpdateValueMissingVisitor(aNotify);
return new nsRadioUpdateValueMissingVisitor();
}
NS_IMETHODIMP_(PRBool)

Просмотреть файл

@ -221,7 +221,7 @@ public:
void SetCheckedChangedInternal(PRBool aCheckedChanged);
PRBool GetCheckedChanged();
void AddedToRadioGroup(PRBool aNotify = PR_TRUE);
void WillRemoveFromRadioGroup(PRBool aNotify);
void WillRemoveFromRadioGroup();
/**
* Get the radio group container for this button (form or document)
* @return the radio group container (or null if no form or document)