Bug 690372 - Give an IID to dom::Element. r=ehsan
authorFabien Cazenave <kaze@kompozer.net>
Mon, 21 Nov 2011 16:32:14 +0100
changeset 80575 35b60f8565a7f97bb07b87672201ef66261177b7
parent 80574 7653280aa252e521727566df5325e84392607af9
child 80576 75404dfd5ba5167bc968ae78f5adecbcf6611b00
push id21511
push userbmo@edmorley.co.uk
push dateTue, 22 Nov 2011 02:38:00 +0000
treeherdermozilla-central@b8955ff00aae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs690372
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 690372 - Give an IID to dom::Element. r=ehsan
content/base/public/Element.h
content/base/src/nsGenericElement.cpp
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -83,26 +83,33 @@ enum {
   ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4
 };
 
 namespace mozilla {
 namespace dom {
 
 class Link;
 
+// IID for the dom::Element interface
+#define NS_ELEMENT_IID      \
+{ 0xa1588efb, 0x5a84, 0x49cd, \
+  { 0x99, 0x1a, 0xac, 0x84, 0x9d, 0x92, 0x05, 0x0f } }
+
 class Element : public nsIContent
 {
 public:
 #ifdef MOZILLA_INTERNAL_API
   Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
     nsIContent(aNodeInfo),
     mState(NS_EVENT_STATE_MOZ_READONLY)
   {}
 #endif // MOZILLA_INTERNAL_API
 
+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ELEMENT_IID)
+
   NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(Element, nsIContent)
 
   /**
    * Method to get the full state of this element.  See nsEventStates.h for
    * the possible bits that could be set here.
    */
   nsEventStates State() const {
     // mState is maintained by having whoever might have changed it
@@ -182,16 +189,18 @@ private:
                     "Should only be removing ESM-managed states here");
     RemoveStatesSilently(aStates);
     NotifyStateChange(aStates);
   }
 
   nsEventStates mState;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)
+
 } // namespace dom
 } // namespace mozilla
 
 inline mozilla::dom::Element* nsINode::AsElement() {
   NS_ASSERTION(IsElement(), "Not an element?");
   return static_cast<mozilla::dom::Element*>(this);
 }
 
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -4338,16 +4338,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     }
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 
 NS_INTERFACE_MAP_BEGIN(nsGenericElement)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsGenericElement)
+  NS_INTERFACE_MAP_ENTRY(Element)
   NS_INTERFACE_MAP_ENTRY(nsIContent)
   NS_INTERFACE_MAP_ENTRY(nsINode)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSElement, new nsNSElementTearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
                                  new nsNodeSupportsWeakRefTearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNodeSelector,
                                  new nsNodeSelectorTearoff(this))