Bug 1270349 part 5. Use LegacyUnenumerableNamedProperties instead of passing flags to GetSupportedNames to determine whether named props on DOM proxies should be reflected in ownPropertyKeys. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 09 May 2016 22:25:40 -0400
changeset 365166 29ee431f39218378889fb821d448487497a0d1fd
parent 365165 db1255660184afab1d0b1a490a709ecfba770a62
child 365167 ba36438e7258b37e6a3d2552393ec1a2018e2ddb
push id17650
push usermartin.thomson@gmail.com
push dateTue, 10 May 2016 05:06:10 +0000
reviewerspeterv
bugs1270349
milestone49.0a1
Bug 1270349 part 5. Use LegacyUnenumerableNamedProperties instead of passing flags to GetSupportedNames to determine whether named props on DOM proxies should be reflected in ownPropertyKeys. r=peterv
dom/base/WindowNamedPropertiesHandler.cpp
dom/base/nsContentList.cpp
dom/base/nsContentList.h
dom/base/nsDOMAttributeMap.cpp
dom/base/nsDOMAttributeMap.h
dom/base/nsMimeTypeArray.cpp
dom/base/nsMimeTypeArray.h
dom/base/nsPluginArray.cpp
dom/base/nsPluginArray.h
dom/bindings/Codegen.py
dom/bindings/test/TestBindingHeader.h
dom/camera/DOMCameraCapabilities.cpp
dom/camera/DOMCameraCapabilities.h
dom/html/HTMLAllCollection.cpp
dom/html/HTMLAllCollection.h
dom/html/HTMLFormControlsCollection.cpp
dom/html/HTMLFormControlsCollection.h
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLOptionsCollection.h
dom/html/HTMLPropertiesCollection.cpp
dom/html/HTMLPropertiesCollection.h
dom/html/HTMLTableElement.cpp
dom/html/nsDOMStringMap.cpp
dom/html/nsDOMStringMap.h
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
dom/html/nsIHTMLCollection.h
dom/storage/DOMStorage.cpp
dom/storage/DOMStorage.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeColumns.h
--- a/dom/base/WindowNamedPropertiesHandler.cpp
+++ b/dom/base/WindowNamedPropertiesHandler.cpp
@@ -207,17 +207,19 @@ WindowNamedPropertiesHandler::ownPropNam
   }
 
   names.Clear();
   nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(win->GetExtantDoc());
   if (!htmlDoc) {
     return true;
   }
   nsHTMLDocument* document = static_cast<nsHTMLDocument*>(htmlDoc.get());
-  document->GetSupportedNames(flags, names);
+  // Document names are enumerable, so we want to get them no matter what flags
+  // is.
+  document->GetSupportedNames(names);
 
   JS::AutoIdVector docProps(aCx);
   if (!AppendNamedPropertyIds(aCx, aProxy, names, false, docProps)) {
     return false;
   }
 
   return js::AppendUnique(aCx, aProps, docProps);
 }
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -532,22 +532,18 @@ nsContentList::NamedItem(const nsAString
       return content->AsElement();
     }
   }
 
   return nullptr;
 }
 
 void
-nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
+nsContentList::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   BringSelfUpToDate(true);
 
   AutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < mElements.Length(); ++i) {
     nsIContent *content = mElements.ElementAt(i);
     if (content->HasID()) {
       nsIAtom* id = content->GetID();
       MOZ_ASSERT(id != nsGkAtoms::_empty,
--- a/dom/base/nsContentList.h
+++ b/dom/base/nsContentList.h
@@ -286,18 +286,17 @@ public:
   virtual mozilla::dom::Element* GetElementAt(uint32_t index) override;
   virtual mozilla::dom::Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) override
   {
     mozilla::dom::Element* item = NamedItem(aName, true);
     aFound = !!item;
     return item;
   }
-  virtual void GetSupportedNames(unsigned aFlags,
-                                 nsTArray<nsString>& aNames) override;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
 
   // nsContentList public methods
   uint32_t Length(bool aDoFlush);
   nsIContent* Item(uint32_t aIndex, bool aDoFlush);
   mozilla::dom::Element*
   NamedItem(const nsAString& aName, bool aDoFlush);
 
   // nsIMutationObserver
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -159,23 +159,18 @@ nsDOMAttributeMap::NamedGetter(const nsA
     return nullptr;
   }
 
   aFound = true;
   return GetAttribute(ni);
 }
 
 void
-nsDOMAttributeMap::GetSupportedNames(unsigned aFlags,
-                                     nsTArray<nsString>& aNames)
+nsDOMAttributeMap::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   // For HTML elements in HTML documents, only include names that are still the
   // same after ASCII-lowercasing, since our named getter will end up
   // ASCII-lowercasing the given string.
   bool lowercaseNamesOnly =
     mContent->IsHTMLElement() && mContent->IsInHTMLDocument();
 
   const uint32_t count = mContent->GetAttrCount();
   bool seenNonAtomName = false;
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -153,17 +153,17 @@ public:
                  const nsAString& aLocalName);
   already_AddRefed<Attr>
   SetNamedItemNS(Attr& aNode, ErrorResult& aError);
   already_AddRefed<Attr>
   RemoveNamedItemNS(const nsAString& aNamespaceURI, const nsAString& aLocalName,
                     ErrorResult& aError);
 
   void
-  GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
+  GetSupportedNames(nsTArray<nsString>& aNames);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 protected:
   virtual ~nsDOMAttributeMap();
 
 private:
   nsCOMPtr<Element> mContent;
--- a/dom/base/nsMimeTypeArray.cpp
+++ b/dom/base/nsMimeTypeArray.cpp
@@ -126,17 +126,17 @@ uint32_t
 nsMimeTypeArray::Length()
 {
   EnsurePluginMimeTypes();
 
   return mMimeTypes.Length();
 }
 
 void
-nsMimeTypeArray::GetSupportedNames(unsigned, nsTArray< nsString >& aRetval)
+nsMimeTypeArray::GetSupportedNames(nsTArray< nsString >& aRetval)
 {
   EnsurePluginMimeTypes();
 
   for (uint32_t i = 0; i < mMimeTypes.Length(); ++i) {
     aRetval.AppendElement(mMimeTypes[i]->Type());
   }
 }
 
--- a/dom/base/nsMimeTypeArray.h
+++ b/dom/base/nsMimeTypeArray.h
@@ -31,17 +31,17 @@ public:
   void Refresh();
 
   // MimeTypeArray WebIDL methods
   nsMimeType* Item(uint32_t index);
   nsMimeType* NamedItem(const nsAString& name);
   nsMimeType* IndexedGetter(uint32_t index, bool &found);
   nsMimeType* NamedGetter(const nsAString& name, bool &found);
   uint32_t Length();
-  void GetSupportedNames(unsigned, nsTArray< nsString >& retval);
+  void GetSupportedNames(nsTArray<nsString>& retval);
 
 protected:
   virtual ~nsMimeTypeArray();
 
   void EnsurePluginMimeTypes();
   void Clear();
 
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
--- a/dom/base/nsPluginArray.cpp
+++ b/dom/base/nsPluginArray.cpp
@@ -232,17 +232,17 @@ nsPluginArray::Length()
   }
 
   EnsurePlugins();
 
   return mPlugins.Length();
 }
 
 void
-nsPluginArray::GetSupportedNames(unsigned, nsTArray<nsString>& aRetval)
+nsPluginArray::GetSupportedNames(nsTArray<nsString>& aRetval)
 {
   aRetval.Clear();
 
   if (!AllowPlugins()) {
     return;
   }
 
   for (uint32_t i = 0; i < mPlugins.Length(); ++i) {
@@ -417,17 +417,17 @@ uint32_t
 nsPluginElement::Length()
 {
   EnsurePluginMimeTypes();
 
   return mMimeTypes.Length();
 }
 
 void
-nsPluginElement::GetSupportedNames(unsigned, nsTArray<nsString>& retval)
+nsPluginElement::GetSupportedNames(nsTArray<nsString>& retval)
 {
   EnsurePluginMimeTypes();
 
   for (uint32_t i = 0; i < mMimeTypes.Length(); ++i) {
     retval.AppendElement(mMimeTypes[i]->Type());
   }
 }
 
--- a/dom/base/nsPluginArray.h
+++ b/dom/base/nsPluginArray.h
@@ -45,17 +45,17 @@ public:
   // PluginArray WebIDL methods
 
   nsPluginElement* Item(uint32_t aIndex);
   nsPluginElement* NamedItem(const nsAString& aName);
   void Refresh(bool aReloadDocuments);
   nsPluginElement* IndexedGetter(uint32_t aIndex, bool &aFound);
   nsPluginElement* NamedGetter(const nsAString& aName, bool &aFound);
   uint32_t Length();
-  void GetSupportedNames(unsigned, nsTArray<nsString>& aRetval);
+  void GetSupportedNames(nsTArray<nsString>& aRetval);
 
 private:
   virtual ~nsPluginArray();
 
   bool AllowPlugins() const;
   void EnsurePlugins();
 
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
@@ -86,17 +86,17 @@ public:
   void GetFilename(nsString& retval) const;
   void GetVersion(nsString& retval) const;
   void GetName(nsString& retval) const;
   nsMimeType* Item(uint32_t index);
   nsMimeType* NamedItem(const nsAString& name);
   nsMimeType* IndexedGetter(uint32_t index, bool &found);
   nsMimeType* NamedGetter(const nsAString& name, bool &found);
   uint32_t Length();
-  void GetSupportedNames(unsigned, nsTArray<nsString>& retval);
+  void GetSupportedNames(nsTArray<nsString>& retval);
 
   nsTArray<RefPtr<nsMimeType> >& MimeTypes();
 
 protected:
   ~nsPluginElement();
 
   void EnsurePluginMimeTypes();
 
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -11290,24 +11290,27 @@ class CGDOMJSProxyHandler_ownPropNames(C
 
         if self.descriptor.supportsNamedProperties():
             if self.descriptor.interface.getExtendedAttribute('OverrideBuiltins'):
                 shadow = "!isXray"
             else:
                 shadow = "false"
             addNames = fill(
                 """
-
                 nsTArray<nsString> names;
-                UnwrapProxy(proxy)->GetSupportedNames(flags, names);
+                UnwrapProxy(proxy)->GetSupportedNames(names);
                 if (!AppendNamedPropertyIds(cx, proxy, names, ${shadow}, props)) {
                   return false;
                 }
                 """,
                 shadow=shadow)
+            if not self.descriptor.namedPropertiesEnumerable:
+                addNames = CGIfWrapper(CGGeneric(addNames),
+                                       "flags & JSITER_HIDDEN").define()
+            addNames = "\n" + addNames
         else:
             addNames = ""
 
         return fill(
             """
             bool isXray = xpc::WrapperFactory::IsXrayWrapper(proxy);
             $*{addIndices}
             $*{addNames}
@@ -14118,29 +14121,25 @@ class CGBindingImplClass(CGClass):
             if not haveLengthAttr:
                 self.methodDecls.append(
                     CGNativeMember(descriptor, FakeMember(),
                                    "Length",
                                    (BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
                                     []),
                                    {"infallible": True}))
         # And if we support named properties we need to be able to
-        # enumerate the supported names and test whether they're enumerable.
+        # enumerate the supported names.
         if descriptor.supportsNamedProperties():
             self.methodDecls.append(
                 CGNativeMember(
                     descriptor, FakeMember(),
                     "GetSupportedNames",
                     (IDLSequenceType(None,
                                      BuiltinTypes[IDLBuiltinType.Types.domstring]),
-                     # Let's use unsigned long for the type here, though really
-                     # it's just a C++ "unsigned"...
-                     [FakeArgument(BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
-                                   FakeMember(),
-                                   name="aFlags")]),
+                     []),
                     {"infallible": True}))
 
         wrapArgs = [Argument('JSContext*', 'aCx'),
                     Argument('JS::Handle<JSObject*>', 'aGivenProto')]
         if not descriptor.wrapperCache:
             wrapReturnType = "bool"
             wrapArgs.append(Argument('JS::MutableHandle<JSObject*>',
                                      'aReflector'))
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -1132,30 +1132,30 @@ class TestNamedGetterInterface : public 
 {
 public:
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   void NamedGetter(const nsAString&, bool&, nsAString&);
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestIndexedGetterAndSetterAndNamedGetterInterface : public nsISupports,
                                                           public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   void NamedGetter(const nsAString&, bool&, nsAString&);
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
   int32_t IndexedGetter(uint32_t, bool&);
   void IndexedSetter(uint32_t, int32_t);
   uint32_t Length();
 };
 
 class TestIndexedAndNamedGetterInterface : public nsISupports,
                                            public nsWrapperCache
 {
@@ -1164,17 +1164,17 @@ public:
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   uint32_t IndexedGetter(uint32_t, bool&);
   void NamedGetter(const nsAString&, bool&, nsAString&);
   void NamedItem(const nsAString&, nsAString&);
   uint32_t Length();
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestIndexedSetterInterface : public nsISupports,
                                    public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
@@ -1193,17 +1193,17 @@ class TestNamedSetterInterface : public 
 public:
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
   TestIndexedSetterInterface* NamedGetter(const nsAString&, bool&);
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestIndexedAndNamedSetterInterface : public nsISupports,
                                            public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
@@ -1211,32 +1211,32 @@ public:
   virtual nsISupports* GetParentObject();
 
   void IndexedSetter(uint32_t, TestIndexedSetterInterface&);
   TestIndexedSetterInterface* IndexedGetter(uint32_t, bool&);
   uint32_t Length();
   void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
   TestIndexedSetterInterface* NamedGetter(const nsAString&, bool&);
   void SetNamedItem(const nsAString&, TestIndexedSetterInterface&);
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestIndexedAndNamedGetterAndSetterInterface : public TestIndexedSetterInterface
 {
 public:
   uint32_t IndexedGetter(uint32_t, bool&);
   uint32_t Item(uint32_t);
   void NamedGetter(const nsAString&, bool&, nsAString&);
   void NamedItem(const nsAString&, nsAString&);
   void IndexedSetter(uint32_t, int32_t&);
   void IndexedSetter(uint32_t, const nsAString&) = delete;
   void NamedSetter(const nsAString&, const nsAString&);
   void Stringify(nsAString&);
   uint32_t Length();
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestCppKeywordNamedMethodsInterface : public nsISupports,
                                             public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
@@ -1288,34 +1288,34 @@ class TestNamedDeleterInterface : public
 public:
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   void NamedDeleter(const nsAString&, bool&);
   long NamedGetter(const nsAString&, bool&);
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestNamedDeleterWithRetvalInterface : public nsISupports,
                                             public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   bool NamedDeleter(const nsAString&, bool&);
   bool NamedDeleter(const nsAString&) = delete;
   long NamedGetter(const nsAString&, bool&);
   bool DelNamedItem(const nsAString&);
   bool DelNamedItem(const nsAString&, bool&) = delete;
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestIndexedAndNamedDeleterInterface : public nsISupports,
                                             public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
@@ -1326,17 +1326,17 @@ public:
   long IndexedGetter(uint32_t, bool&);
   uint32_t Length();
 
   void NamedDeleter(const nsAString&, bool&);
   void NamedDeleter(const nsAString&) = delete;
   long NamedGetter(const nsAString&, bool&);
   void DelNamedItem(const nsAString&);
   void DelNamedItem(const nsAString&, bool&) = delete;
-  void GetSupportedNames(unsigned, nsTArray<nsString>&);
+  void GetSupportedNames(nsTArray<nsString>&);
 };
 
 class TestParentInterface : public nsISupports,
                             public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS
 
--- a/dom/camera/DOMCameraCapabilities.cpp
+++ b/dom/camera/DOMCameraCapabilities.cpp
@@ -234,20 +234,20 @@ CameraRecorderProfiles::CameraRecorderPr
 }
 
 CameraRecorderProfiles::~CameraRecorderProfiles()
 {
   DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
 }
 
 void
-CameraRecorderProfiles::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
+CameraRecorderProfiles::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  DOM_CAMERA_LOGT("%s:%d : this=%p, flags=0x%x\n",
-    __func__, __LINE__, this, aFlags);
+  DOM_CAMERA_LOGT("%s:%d : this=%p\n",
+    __func__, __LINE__, this);
   if (!mCameraControl) {
     aNames.Clear();
     return;
   }
 
   nsresult rv = mCameraControl->GetRecorderProfiles(aNames);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     aNames.Clear();
--- a/dom/camera/DOMCameraCapabilities.h
+++ b/dom/camera/DOMCameraCapabilities.h
@@ -156,17 +156,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CameraRecorderProfiles)
 
   explicit CameraRecorderProfiles(nsISupports* aParent,
                                   ICameraControl* aCameraControl);
   nsISupports* GetParentObject() const { return mParent; }
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   CameraRecorderProfile* NamedGetter(const nsAString& aName, bool& aFound);
-  void GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
+  void GetSupportedNames(nsTArray<nsString>& aNames);
 
   virtual void OnHardwareClosed();
 
 protected:
   virtual ~CameraRecorderProfiles();
 
   nsCOMPtr<nsISupports> mParent;
   RefPtr<ICameraControl> mCameraControl;
--- a/dom/html/HTMLAllCollection.cpp
+++ b/dom/html/HTMLAllCollection.cpp
@@ -155,22 +155,18 @@ HTMLAllCollection::NamedGetter(const nsA
     return;
   }
 
   aFound = false;
   aResult.SetNull();
 }
 
 void
-HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
+HTMLAllCollection::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   // XXXbz this is very similar to nsContentList::GetSupportedNames,
   // but has to check IsAllNamedElement for the name case.
   AutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < Length(); ++i) {
     nsIContent *content = Item(i);
     if (content->HasID()) {
       nsIAtom* id = content->GetID();
       MOZ_ASSERT(id != nsGkAtoms::_empty,
--- a/dom/html/HTMLAllCollection.h
+++ b/dom/html/HTMLAllCollection.h
@@ -57,17 +57,17 @@ public:
                  Nullable<OwningNodeOrHTMLCollection>& aResult)
   {
     bool found = false;
     NamedGetter(aName, found, aResult);
   }
   void NamedGetter(const nsAString& aName,
                    bool& aFound,
                    Nullable<OwningNodeOrHTMLCollection>& aResult);
-  void GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
+  void GetSupportedNames(nsTArray<nsString>& aNames);
   void LegacyCall(JS::Handle<JS::Value>, const nsAString& aName,
                   Nullable<OwningNodeOrHTMLCollection>& aResult)
   {
     NamedItem(aName, aResult);
   }
 
 private:
   nsContentList* Collection();
--- a/dom/html/HTMLFormControlsCollection.cpp
+++ b/dom/html/HTMLFormControlsCollection.cpp
@@ -385,23 +385,18 @@ HTMLFormControlsCollection::NamedGetter(
   if (nsCOMPtr<RadioNodeList> nodelist = do_QueryInterface(item)) {
     aResult.SetValue().SetAsRadioNodeList() = nodelist;
     return;
   }
   MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
 }
 
 void
-HTMLFormControlsCollection::GetSupportedNames(unsigned aFlags,
-                                              nsTArray<nsString>& aNames)
+HTMLFormControlsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   FlushPendingNotifications();
   // Just enumerate mNameLookupTable.  This won't guarantee order, but
   // that's OK, because the HTML5 spec doesn't define an order for
   // this enumeration.
   for (auto iter = mNameLookupTable.Iter(); !iter.Done(); iter.Next()) {
     aNames.AppendElement(iter.Key());
   }
 }
--- a/dom/html/HTMLFormControlsCollection.h
+++ b/dom/html/HTMLFormControlsCollection.h
@@ -48,18 +48,17 @@ public:
               Nullable<OwningRadioNodeListOrElement>& aResult);
   void
   NamedItem(const nsAString& aName,
             Nullable<OwningRadioNodeListOrElement>& aResult)
   {
     bool dummy;
     NamedGetter(aName, dummy, aResult);
   }
-  virtual void GetSupportedNames(unsigned aFlags,
-                                 nsTArray<nsString>& aNames) override;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
 
   nsresult AddElementToTable(nsGenericHTMLFormElement* aChild,
                              const nsAString& aName);
   nsresult AddImageElementToTable(HTMLImageElement* aChild,
                                   const nsAString& aName);
   nsresult RemoveElementFromTable(nsGenericHTMLFormElement* aChild,
                                   const nsAString& aName);
   nsresult IndexOfControl(nsIFormControl* aControl,
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -1534,17 +1534,17 @@ HTMLFormElement::NamedGetter(const nsASt
     return result.forget();
   }
 
   aFound = false;
   return nullptr;
 }
 
 void
-HTMLFormElement::GetSupportedNames(unsigned, nsTArray<nsString >& aRetval)
+HTMLFormElement::GetSupportedNames(nsTArray<nsString >& aRetval)
 {
   // TODO https://www.w3.org/Bugs/Public/show_bug.cgi?id=22320
 }
 
 already_AddRefed<nsISupports>
 HTMLFormElement::FindNamedItem(const nsAString& aName,
                                nsWrapperCache** aCache)
 {
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -388,17 +388,17 @@ public:
   }
 
   Element*
   IndexedGetter(uint32_t aIndex, bool &aFound);
 
   already_AddRefed<nsISupports>
   NamedGetter(const nsAString& aName, bool &aFound);
 
-  void GetSupportedNames(unsigned, nsTArray<nsString >& aRetval);
+  void GetSupportedNames(nsTArray<nsString>& aRetval);
 
   static int32_t
   CompareFormControlPosition(Element* aElement1, Element* aElement2,
                              const nsIContent* aForm);
 #ifdef DEBUG
   static void
   AssertDocumentOrder(const nsTArray<nsGenericHTMLFormElement*>& aControls,
                       nsIContent* aForm);
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -275,23 +275,18 @@ HTMLOptionsCollection::NamedItem(const n
                                  nsIDOMNode** aReturn)
 {
   NS_IF_ADDREF(*aReturn = GetNamedItem(aName));
 
   return NS_OK;
 }
 
 void
-HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
-                                         nsTArray<nsString>& aNames)
+HTMLOptionsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   AutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < mElements.Length(); ++i) {
     HTMLOptionElement* content = mElements.ElementAt(i);
     if (content) {
       // Note: HasName means the names is exposed on the document,
       // which is false for options, so we don't check it here.
       const nsAttrValue* val = content->GetParsedAttr(nsGkAtoms::name);
       if (val && val->Type() == nsAttrValue::eAtom) {
--- a/dom/html/HTMLOptionsCollection.h
+++ b/dom/html/HTMLOptionsCollection.h
@@ -149,18 +149,17 @@ public:
   void Remove(int32_t aIndex, ErrorResult& aError);
   int32_t GetSelectedIndex(ErrorResult& aError);
   void SetSelectedIndex(int32_t aSelectedIndex, ErrorResult& aError);
   void IndexedSetter(uint32_t aIndex, nsIDOMHTMLOptionElement* aOption,
                      ErrorResult& aError)
   {
     aError = SetOption(aIndex, aOption);
   }
-  virtual void GetSupportedNames(unsigned aFlags,
-                                 nsTArray<nsString>& aNames) override;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
 
 private:
   /** The list of options (holds strong references).  This is infallible, so
    * various members such as InsertOptionAt are also infallible. */
   nsTArray<RefPtr<mozilla::dom::HTMLOptionElement> > mElements;
   /** The select element that contains this array */
   HTMLSelectElement* mSelect;
 };
--- a/dom/html/HTMLPropertiesCollection.cpp
+++ b/dom/html/HTMLPropertiesCollection.cpp
@@ -283,17 +283,17 @@ HTMLPropertiesCollection::CrawlSubtree(E
       } else {
         aContent = element->GetNextNode(aElement);
       }
     }
   }
 }
 
 void
-HTMLPropertiesCollection::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
+HTMLPropertiesCollection::GetSupportedNames(nsTArray<nsString>& aNames)
 {
   EnsureFresh();
   mNames->CopyList(aNames);
 }
 
 PropertyNodeList::PropertyNodeList(HTMLPropertiesCollection* aCollection,
                                    nsIContent* aParent, const nsAString& aName)
   : mName(aName),
--- a/dom/html/HTMLPropertiesCollection.h
+++ b/dom/html/HTMLPropertiesCollection.h
@@ -90,18 +90,17 @@ public:
     aFound = IsSupportedNamedProperty(aName);
     return aFound ? NamedItem(aName) : nullptr;
   }
   DOMStringList* Names()
   {
     EnsureFresh();
     return mNames;
   }
-  virtual void GetSupportedNames(unsigned,
-                                 nsTArray<nsString>& aNames) override;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
 
   NS_DECL_NSIDOMHTMLCOLLECTION
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -36,18 +36,17 @@ public:
   virtual Element* GetElementAt(uint32_t aIndex) override;
   virtual nsINode* GetParentObject() override
   {
     return mParent;
   }
 
   virtual Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) override;
-  virtual void GetSupportedNames(unsigned aFlags,
-                                 nsTArray<nsString>& aNames) override;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
 
   NS_IMETHOD    ParentDestroyed();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TableRowsCollection)
 
   // nsWrapperCache
   using nsWrapperCache::GetWrapperPreserveColor;
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
@@ -231,28 +230,23 @@ TableRowsCollection::GetFirstNamedElemen
     if (aFound) {
       return item;
     }
   );
   return nullptr;
 }
 
 void
-TableRowsCollection::GetSupportedNames(unsigned aFlags,
-                                       nsTArray<nsString>& aNames)
+TableRowsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
 {
-  if (!(aFlags & JSITER_HIDDEN)) {
-    return;
-  }
-
   DO_FOR_EACH_ROWGROUP(
     nsTArray<nsString> names;
     nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
     if (coll) {
-      coll->GetSupportedNames(aFlags, names);
+      coll->GetSupportedNames(names);
       for (uint32_t i = 0; i < names.Length(); ++i) {
         if (!aNames.Contains(names[i])) {
           aNames.AppendElement(names[i]);
         }
       }
     }
   );
 }
--- a/dom/html/nsDOMStringMap.cpp
+++ b/dom/html/nsDOMStringMap.cpp
@@ -138,17 +138,17 @@ nsDOMStringMap::NamedDeleter(const nsASt
   if (found) {
     mRemovingProp = true;
     mElement->UnsetAttr(kNameSpaceID_None, attrAtom, true);
     mRemovingProp = false;
   }
 }
 
 void
-nsDOMStringMap::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
+nsDOMStringMap::GetSupportedNames(nsTArray<nsString>& aNames)
 {
   uint32_t attrCount = mElement->GetAttrCount();
 
   // Iterate through all the attributes and add property
   // names corresponding to data attributes to return array.
   for (uint32_t i = 0; i < attrCount; ++i) {
     const nsAttrName* attrName = mElement->GetAttrNameAt(i);
     // Skip the ones that are not in the null namespace
--- a/dom/html/nsDOMStringMap.h
+++ b/dom/html/nsDOMStringMap.h
@@ -37,17 +37,17 @@ public:
 
   // WebIDL API
   virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
   void NamedGetter(const nsAString& aProp, bool& found,
                    mozilla::dom::DOMString& aResult) const;
   void NamedSetter(const nsAString& aProp, const nsAString& aValue,
                    mozilla::ErrorResult& rv);
   void NamedDeleter(const nsAString& aProp, bool &found);
-  void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
+  void GetSupportedNames(nsTArray<nsString>& aNames);
 
   js::ExpandoAndGeneration mExpandoAndGeneration;
 
 private:
   virtual ~nsDOMStringMap();
 
 protected:
   RefPtr<nsGenericHTMLElement> mElement;
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -2321,17 +2321,17 @@ nsHTMLDocument::NamedGetter(JSContext* c
     rv.Throw(NS_ERROR_OUT_OF_MEMORY);
     return;
   }
   aFound = true;
   aRetval.set(&val.toObject());
 }
 
 void
-nsHTMLDocument::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
+nsHTMLDocument::GetSupportedNames(nsTArray<nsString>& aNames)
 {
   for (auto iter = mIdentifierMap.Iter(); !iter.Done(); iter.Next()) {
     nsIdentifierMapEntry* entry = iter.Get();
     if (entry->HasNameElement() ||
         entry->HasIdElementExposedAsHTMLDocumentProperty()) {
       aNames.AppendElement(entry->GetKey());
     }
   }
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -169,17 +169,17 @@ public:
   virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
     override;
   void SetDomain(const nsAString& aDomain, mozilla::ErrorResult& rv);
   void GetCookie(nsAString& aCookie, mozilla::ErrorResult& rv);
   void SetCookie(const nsAString& aCookie, mozilla::ErrorResult& rv);
   void NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
                    JS::MutableHandle<JSObject*> aRetval,
                    mozilla::ErrorResult& rv);
-  void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
+  void GetSupportedNames(nsTArray<nsString>& aNames);
   nsGenericHTMLElement *GetBody();
   void SetBody(nsGenericHTMLElement* aBody, mozilla::ErrorResult& rv);
   mozilla::dom::HTMLSharedElement *GetHead() {
     return static_cast<mozilla::dom::HTMLSharedElement*>(GetHeadElement());
   }
   nsIHTMLCollection* Images();
   nsIHTMLCollection* Embeds();
   nsIHTMLCollection* Plugins();
--- a/dom/html/nsIHTMLCollection.h
+++ b/dom/html/nsIHTMLCollection.h
@@ -67,18 +67,17 @@ public:
   }
   mozilla::dom::Element* NamedGetter(const nsAString& aName, bool& aFound)
   {
     return GetFirstNamedElement(aName, aFound);
   }
   virtual mozilla::dom::Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) = 0;
 
-  virtual void GetSupportedNames(unsigned aFlags,
-                                 nsTArray<nsString>& aNames) = 0;
+  virtual void GetSupportedNames(nsTArray<nsString>& aNames) = 0;
 
   JSObject* GetWrapperPreserveColor()
   {
     return GetWrapperPreserveColorInternal();
   }
   JSObject* GetWrapper()
   {
     JSObject* obj = GetWrapperPreserveColor();
--- a/dom/storage/DOMStorage.cpp
+++ b/dom/storage/DOMStorage.cpp
@@ -291,17 +291,17 @@ DOMStorage::PrincipalEquals(nsIPrincipal
 
 bool
 DOMStorage::CanAccess(nsIPrincipal* aPrincipal)
 {
   return !aPrincipal || aPrincipal->Subsumes(mPrincipal);
 }
 
 void
-DOMStorage::GetSupportedNames(unsigned, nsTArray<nsString>& aKeys)
+DOMStorage::GetSupportedNames(nsTArray<nsString>& aKeys)
 {
   if (!CanUseStorage(nullptr, this)) {
     // return just an empty array
     aKeys.Clear();
     return;
   }
 
   mCache->GetKeys(this, aKeys);
--- a/dom/storage/DOMStorage.h
+++ b/dom/storage/DOMStorage.h
@@ -76,17 +76,17 @@ public:
   }
 
   uint32_t GetLength(ErrorResult& aRv);
 
   void Key(uint32_t aIndex, nsAString& aResult, ErrorResult& aRv);
 
   void GetItem(const nsAString& aKey, nsAString& aResult, ErrorResult& aRv);
 
-  void GetSupportedNames(unsigned, nsTArray<nsString>& aKeys);
+  void GetSupportedNames(nsTArray<nsString>& aKeys);
 
   void NamedGetter(const nsAString& aKey, bool& aFound, nsAString& aResult,
                    ErrorResult& aRv)
   {
     GetItem(aKey, aResult, aRv);
     aFound = !aResult.IsVoid();
   }
 
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -616,17 +616,17 @@ nsTreeColumns::GetNamedColumn(const nsAS
 NS_IMETHODIMP
 nsTreeColumns::GetNamedColumn(const nsAString& aId, nsITreeColumn** _retval)
 {
   NS_IF_ADDREF(*_retval = GetNamedColumn(aId));
   return NS_OK;
 }
 
 void
-nsTreeColumns::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
+nsTreeColumns::GetSupportedNames(nsTArray<nsString>& aNames)
 {
   for (nsTreeColumn* currCol = mFirstColumn; currCol; currCol = currCol->GetNext()) {
     aNames.AppendElement(currCol->GetId());
   }
 }
 
 
 nsTreeColumn*
--- a/layout/xul/tree/nsTreeColumns.h
+++ b/layout/xul/tree/nsTreeColumns.h
@@ -182,17 +182,17 @@ public:
   nsTreeColumn* GetKeyColumn();
 
   nsTreeColumn* GetColumnFor(mozilla::dom::Element* aElement);
 
   nsTreeColumn* IndexedGetter(uint32_t aIndex, bool& aFound);
   nsTreeColumn* GetColumnAt(uint32_t aIndex);
   nsTreeColumn* NamedGetter(const nsAString& aId, bool& aFound);
   nsTreeColumn* GetNamedColumn(const nsAString& aId);
-  void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
+  void GetSupportedNames(nsTArray<nsString>& aNames);
 
   // Uses XPCOM InvalidateColumns().
   // Uses XPCOM RestoreNaturalOrder().
 
   friend class nsTreeBodyFrame;
 protected:
   void SetTree(nsTreeBodyFrame* aTree) { mTree = aTree; }