Bug 1386969 - Change nsIRadioGroupContainer::Add/RemoveToRadioGroup() to take HTMLInputElement* as argument. r=bz

Currently, these two functions take nsIFormControl* as argument, but we only
pass HTMLInputElements to it, so we can change it to take HTMLInputElement* to
avoid overhead in casting.

MozReview-Commit-ID: CHG0F3xWCVF
This commit is contained in:
Jessica Jong
2017-08-03 02:39:00 -04:00
parent eb62aade34
commit 03b695cbea
6 changed files with 20 additions and 40 deletions

View File

@@ -6764,7 +6764,7 @@ HTMLInputElement::AddedToRadioGroup()
if (container) {
nsAutoString name;
GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
container->AddToRadioGroup(name, static_cast<nsIFormControl*>(this));
container->AddToRadioGroup(name, this);
// We initialize the validity of the element to the validity of the group
// because we assume UpdateValueMissingState() will be called after.
@@ -6797,7 +6797,7 @@ HTMLInputElement::WillRemoveFromRadioGroup()
// We need to call UpdateValueMissingValidityStateForRadio before to make sure
// the group validity is updated (with this element being ignored).
UpdateValueMissingValidityStateForRadio(true);
container->RemoveFromRadioGroup(name, static_cast<nsIFormControl*>(this));
container->RemoveFromRadioGroup(name, this);
}
bool