Bug 1183901 - Properly support WrapperCache on DistributedContentList. r=wchen, a=2.2+
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sat, 18 Jul 2015 01:15:44 +0300
changeset 238744 f4eaa0dd7621
parent 238743 35c740883fd9
child 238745 1d69c96a0517
push id6
push userryanvm@gmail.com
push dateTue, 28 Jul 2015 03:28:58 +0000
reviewerswchen, 2
bugs1183901
milestone37.0
Bug 1183901 - Properly support WrapperCache on DistributedContentList. r=wchen, a=2.2+
dom/html/HTMLContentElement.cpp
dom/html/HTMLContentElement.h
--- a/dom/html/HTMLContentElement.cpp
+++ b/dom/html/HTMLContentElement.cpp
@@ -292,20 +292,22 @@ HTMLContentElement::Match(nsIContent* aC
 
 already_AddRefed<DistributedContentList>
 HTMLContentElement::GetDistributedNodes()
 {
   nsRefPtr<DistributedContentList> list = new DistributedContentList(this);
   return list.forget();
 }
 
-NS_IMPL_CYCLE_COLLECTION(DistributedContentList, mParent, mDistributedNodes)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DistributedContentList, mParent,
+                                      mDistributedNodes)
 
 NS_INTERFACE_TABLE_HEAD(DistributedContentList)
-  NS_INTERFACE_TABLE(DistributedContentList, nsINodeList)
+  NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
+  NS_INTERFACE_TABLE(DistributedContentList, nsINodeList, nsIDOMNodeList)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(DistributedContentList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DistributedContentList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DistributedContentList)
 
 DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement)
   : mParent(aHostElement)
--- a/dom/html/HTMLContentElement.h
+++ b/dom/html/HTMLContentElement.h
@@ -96,17 +96,17 @@ protected:
 };
 
 class DistributedContentList : public nsINodeList
 {
 public:
   explicit DistributedContentList(HTMLContentElement* aHostElement);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(DistributedContentList)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DistributedContentList)
 
   // nsIDOMNodeList
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList
   virtual nsIContent* Item(uint32_t aIndex) MOZ_OVERRIDE;
   virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE;
   virtual nsINode* GetParentObject() MOZ_OVERRIDE { return mParent; }