Bug 1728081 - Part 2: Remove nsIForm::GetElementAt; r=smaug

as it is only used internally.

Depends on D123949

Differential Revision: https://phabricator.services.mozilla.com/D123950
This commit is contained in:
Edgar Chen
2021-08-30 18:44:51 +00:00
parent 6536c5442c
commit efa48fcbc4
3 changed files with 2 additions and 16 deletions

View File

@@ -603,7 +603,8 @@ nsresult HTMLFormElement::DoReset() {
uint32_t numElements = mControls->Length();
for (uint32_t elementX = 0; elementX < numElements; ++elementX) {
// Hold strong ref in case the reset does something weird
nsCOMPtr<nsIFormControl> controlNode = GetElementAt(elementX);
nsCOMPtr<nsIFormControl> controlNode =
mControls->mElements.SafeElementAt(elementX, nullptr);
if (controlNode) {
controlNode->Reset();
}
@@ -1075,11 +1076,6 @@ Element* HTMLFormElement::IndexedGetter(uint32_t aIndex, bool& aFound) {
return element;
}
NS_IMETHODIMP_(nsIFormControl*)
HTMLFormElement::GetElementAt(int32_t aIndex) const {
return mControls->mElements.SafeElementAt(aIndex, nullptr);
}
/**
* Compares the position of aControl1 and aControl2 in the document
* @param aControl1 First control to compare.