forked from mirrors/gecko-dev
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:
parent
950a3c620d
commit
1273773f91
5 changed files with 7 additions and 5 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
#include "nsContentList.h"
|
#include "nsContentList.h"
|
||||||
#include "mozilla/dom/HTMLInputElement.h"
|
#include "mozilla/dom/HTMLInputElement.h"
|
||||||
#include "mozilla/dom/HTMLTextAreaElement.h"
|
#include "mozilla/dom/HTMLTextAreaElement.h"
|
||||||
|
#include "mozilla/dom/HTMLFormControlsCollection.h"
|
||||||
#include "nsIFormControl.h"
|
#include "nsIFormControl.h"
|
||||||
|
|
||||||
#include "mozilla/FloatingPoint.h"
|
#include "mozilla/FloatingPoint.h"
|
||||||
|
|
@ -48,7 +49,7 @@ void HTMLFormAccessible::DOMAttributeChanged(int32_t aNameSpaceID,
|
||||||
if (aAttribute == nsGkAtoms::autocomplete) {
|
if (aAttribute == nsGkAtoms::autocomplete) {
|
||||||
dom::HTMLFormElement* formEl = dom::HTMLFormElement::FromNode(mContent);
|
dom::HTMLFormElement* formEl = dom::HTMLFormElement::FromNode(mContent);
|
||||||
|
|
||||||
nsIHTMLCollection* controls = formEl->Elements();
|
HTMLFormControlsCollection* controls = formEl->Elements();
|
||||||
uint32_t length = controls->Length();
|
uint32_t length = controls->Length();
|
||||||
for (uint32_t i = 0; i < length; i++) {
|
for (uint32_t i = 0; i < length; i++) {
|
||||||
if (LocalAccessible* acc = mDoc->GetAccessible(controls->Item(i))) {
|
if (LocalAccessible* acc = mDoc->GetAccessible(controls->Item(i))) {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ class HTMLFormControlsCollection final : public nsIHTMLCollection,
|
||||||
nsTArray<RefPtr<nsGenericHTMLFormElement>>& aControls) const;
|
nsTArray<RefPtr<nsGenericHTMLFormElement>>& aControls) const;
|
||||||
|
|
||||||
// nsWrapperCache
|
// nsWrapperCache
|
||||||
|
using nsWrapperCache::GetWrapper;
|
||||||
using nsWrapperCache::GetWrapperPreserveColor;
|
using nsWrapperCache::GetWrapperPreserveColor;
|
||||||
using nsWrapperCache::PreserveWrapper;
|
using nsWrapperCache::PreserveWrapper;
|
||||||
virtual JSObject* WrapObject(JSContext* aCx,
|
virtual JSObject* WrapObject(JSContext* aCx,
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ nsDOMTokenList* HTMLFormElement::RelList() {
|
||||||
|
|
||||||
NS_IMPL_ELEMENT_CLONE(HTMLFormElement)
|
NS_IMPL_ELEMENT_CLONE(HTMLFormElement)
|
||||||
|
|
||||||
nsIHTMLCollection* HTMLFormElement::Elements() { return mControls; }
|
HTMLFormControlsCollection* HTMLFormElement::Elements() { return mControls; }
|
||||||
|
|
||||||
void HTMLFormElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
void HTMLFormElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||||
const nsAttrValue* aValue, bool aNotify) {
|
const nsAttrValue* aValue, bool aNotify) {
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ class HTMLFormElement final : public nsGenericHTMLElement,
|
||||||
|
|
||||||
// it's only out-of-line because the class definition is not available in the
|
// it's only out-of-line because the class definition is not available in the
|
||||||
// header
|
// header
|
||||||
nsIHTMLCollection* Elements();
|
HTMLFormControlsCollection* Elements();
|
||||||
|
|
||||||
int32_t Length();
|
int32_t Length();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ interface HTMLFormElement : HTMLElement {
|
||||||
[PutForwards=value]
|
[PutForwards=value]
|
||||||
readonly attribute DOMTokenList relList;
|
readonly attribute DOMTokenList relList;
|
||||||
|
|
||||||
[Constant]
|
[SameObject]
|
||||||
readonly attribute HTMLCollection elements;
|
readonly attribute HTMLFormControlsCollection elements;
|
||||||
[Pure]
|
[Pure]
|
||||||
readonly attribute long length;
|
readonly attribute long length;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue