Bug 1390660, part 1 - Clean up some uses of the table-to-map segue. r=peterv draft
authorAndrew McCreight <continuation@gmail.com>
Wed, 16 Aug 2017 13:37:20 -0700
changeset 659215 7710c16af6378298355302df0889ede687ad5575
parent 659065 3ecda4678c49ca255c38b1697142b9118cdd27e7
child 659216 54ca4739a50b9f2897c2bd4714f2ad4da3387f5f
push id78051
push userbmo:continuation@gmail.com
push dateTue, 05 Sep 2017 17:38:43 +0000
reviewerspeterv
bugs1390660
milestone57.0a1
Bug 1390660, part 1 - Clean up some uses of the table-to-map segue. r=peterv In a number of places, there's no substantial use of maps any more after the segue. The ELEMENT segue tries the FragmentOrElement QI, but that is redundant with the Element QI. This lets me use a few higher-level macros. MozReview-Commit-ID: Gstq3Cm8LDl
dom/html/HTMLEmbedElement.cpp
dom/xbl/XBLChildrenElement.cpp
layout/style/nsDOMCSSDeclaration.cpp
--- a/dom/html/HTMLEmbedElement.cpp
+++ b/dom/html/HTMLEmbedElement.cpp
@@ -63,18 +63,17 @@ NS_INTERFACE_TABLE_INHERITED(HTMLEmbedEl
                              nsIRequestObserver,
                              nsIStreamListener,
                              nsIFrameLoaderOwner,
                              nsIObjectLoadingContent,
                              imgINotificationObserver,
                              nsIImageLoadingContent,
                              imgIOnloadBlocker,
                              nsIChannelEventSink)
-NS_INTERFACE_TABLE_TO_MAP_SEGUE
-NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
+NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
 
 NS_IMPL_ELEMENT_CLONE(HTMLEmbedElement)
 
 #ifdef XP_MACOSX
 
 NS_IMETHODIMP
 HTMLEmbedElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
 {
--- a/dom/xbl/XBLChildrenElement.cpp
+++ b/dom/xbl/XBLChildrenElement.cpp
@@ -11,24 +11,20 @@
 
 namespace mozilla {
 namespace dom {
 
 XBLChildrenElement::~XBLChildrenElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(XBLChildrenElement, Element)
-NS_IMPL_RELEASE_INHERITED(XBLChildrenElement, Element)
-
-NS_INTERFACE_TABLE_HEAD(XBLChildrenElement)
-  NS_INTERFACE_TABLE_INHERITED(XBLChildrenElement, nsIDOMNode,
-                               nsIDOMElement)
-  NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE
-NS_INTERFACE_MAP_END_INHERITING(Element)
+NS_IMPL_ISUPPORTS_INHERITED(XBLChildrenElement,
+                            Element,
+                            nsIDOMNode,
+                            nsIDOMElement)
 
 NS_IMPL_ELEMENT_CLONE(XBLChildrenElement)
 
 nsresult
 XBLChildrenElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                   const nsAttrValueOrString* aValue,
                                   bool aNotify)
 {
@@ -55,21 +51,18 @@ using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsAnonymousContentList, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAnonymousContentList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsAnonymousContentList)
 
 NS_INTERFACE_TABLE_HEAD(nsAnonymousContentList)
   NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
-  NS_INTERFACE_TABLE_INHERITED(nsAnonymousContentList, nsINodeList,
-                               nsIDOMNodeList)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE
-  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsAnonymousContentList)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
+  NS_INTERFACE_TABLE(nsAnonymousContentList, nsINodeList, nsIDOMNodeList)
+  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsAnonymousContentList)
 NS_INTERFACE_MAP_END
 
 NS_IMETHODIMP
 nsAnonymousContentList::GetLength(uint32_t* aLength)
 {
   if (!mParent) {
     *aLength = 0;
     return NS_OK;
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -28,22 +28,19 @@ nsDOMCSSDeclaration::~nsDOMCSSDeclaratio
 }
 
 /* virtual */ JSObject*
 nsDOMCSSDeclaration::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return dom::CSS2PropertiesBinding::Wrap(aCx, this, aGivenProto);
 }
 
-NS_INTERFACE_TABLE_HEAD(nsDOMCSSDeclaration)
-  NS_INTERFACE_TABLE(nsDOMCSSDeclaration,
-                     nsICSSDeclaration,
-                     nsIDOMCSSStyleDeclaration)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE
-NS_INTERFACE_MAP_END
+NS_IMPL_QUERY_INTERFACE(nsDOMCSSDeclaration,
+                        nsICSSDeclaration,
+                        nsIDOMCSSStyleDeclaration)
 
 NS_IMETHODIMP
 nsDOMCSSDeclaration::GetPropertyValue(const nsCSSPropertyID aPropID,
                                       nsAString& aValue)
 {
   NS_PRECONDITION(aPropID != eCSSProperty_UNKNOWN,
                   "Should never pass eCSSProperty_UNKNOWN around");