Bug 1728081 - Part 1: Remove nsIForm::GetElementCount; r=smaug

as it is only used internally.

Differential Revision: https://phabricator.services.mozilla.com/D123949
This commit is contained in:
Edgar Chen
2021-08-30 18:44:50 +00:00
parent 61608d58e7
commit 6536c5442c
3 changed files with 1 additions and 13 deletions

View File

@@ -600,7 +600,7 @@ nsresult HTMLFormElement::DoReset() {
mEverTriedInvalidSubmit = false;
// JBK walk the elements[] array instead of form frame controls - bug 34297
uint32_t numElements = GetElementCount();
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);
@@ -1069,9 +1069,6 @@ NotNull<const Encoding*> HTMLFormElement::GetSubmitEncoding() {
// nsIForm
NS_IMETHODIMP_(uint32_t)
HTMLFormElement::GetElementCount() const { return mControls->Length(); }
Element* HTMLFormElement::IndexedGetter(uint32_t aIndex, bool& aFound) {
Element* element = mControls->mElements.SafeElementAt(aIndex, nullptr);
aFound = element != nullptr;