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
Родитель bb4c23a6e6
Коммит 09f6c7e2de
3 изменённых файлов: 2 добавлений и 16 удалений

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

@ -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.

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

@ -56,7 +56,6 @@ class HTMLFormElement final : public nsGenericHTMLElement,
NS_DECL_ISUPPORTS_INHERITED
// nsIForm
NS_IMETHOD_(nsIFormControl*) GetElementAt(int32_t aIndex) const override;
NS_IMETHOD_(int32_t) IndexOfControl(nsIFormControl* aControl) override;
NS_IMETHOD_(nsIFormControl*) GetDefaultSubmitElement() const override;

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

@ -35,15 +35,6 @@ class nsIForm : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFORM_IID)
/**
* Get the element at a specified index position in form.elements
*
* @param aIndex the index
* @param aElement the element at that index
* @return NS_OK if there was an element at that position, -1 otherwise
*/
NS_IMETHOD_(nsIFormControl*) GetElementAt(int32_t aIndex) const = 0;
/**
* Get the index of the given control within form.elements.
* @param aControl the control to find the index of