Bug 1066940 - Align return type of HTMLFormElement::elements with spec. r=dom-core,webidl,peterv

Differential Revision: https://phabricator.services.mozilla.com/D188246
This commit is contained in:
Vincent Hilla 2023-09-14 16:37:14 +00:00
parent 950a3c620d
commit 1273773f91
5 changed files with 7 additions and 5 deletions

View file

@ -18,6 +18,7 @@
#include "nsContentList.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLTextAreaElement.h"
#include "mozilla/dom/HTMLFormControlsCollection.h"
#include "nsIFormControl.h"
#include "mozilla/FloatingPoint.h"
@ -48,7 +49,7 @@ void HTMLFormAccessible::DOMAttributeChanged(int32_t aNameSpaceID,
if (aAttribute == nsGkAtoms::autocomplete) {
dom::HTMLFormElement* formEl = dom::HTMLFormElement::FromNode(mContent);
nsIHTMLCollection* controls = formEl->Elements();
HTMLFormControlsCollection* controls = formEl->Elements();
uint32_t length = controls->Length();
for (uint32_t i = 0; i < length; i++) {
if (LocalAccessible* acc = mDoc->GetAccessible(controls->Item(i))) {

View file

@ -74,6 +74,7 @@ class HTMLFormControlsCollection final : public nsIHTMLCollection,
nsTArray<RefPtr<nsGenericHTMLFormElement>>& aControls) const;
// nsWrapperCache
using nsWrapperCache::GetWrapper;
using nsWrapperCache::GetWrapperPreserveColor;
using nsWrapperCache::PreserveWrapper;
virtual JSObject* WrapObject(JSContext* aCx,

View file

@ -179,7 +179,7 @@ nsDOMTokenList* HTMLFormElement::RelList() {
NS_IMPL_ELEMENT_CLONE(HTMLFormElement)
nsIHTMLCollection* HTMLFormElement::Elements() { return mControls; }
HTMLFormControlsCollection* HTMLFormElement::Elements() { return mControls; }
void HTMLFormElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName,
const nsAttrValue* aValue, bool aNotify) {

View file

@ -329,7 +329,7 @@ class HTMLFormElement final : public nsGenericHTMLElement,
// it's only out-of-line because the class definition is not available in the
// header
nsIHTMLCollection* Elements();
HTMLFormControlsCollection* Elements();
int32_t Length();

View file

@ -39,8 +39,8 @@ interface HTMLFormElement : HTMLElement {
[PutForwards=value]
readonly attribute DOMTokenList relList;
[Constant]
readonly attribute HTMLCollection elements;
[SameObject]
readonly attribute HTMLFormControlsCollection elements;
[Pure]
readonly attribute long length;