diff --git a/content/mathml/content/src/nsMathMLElement.cpp b/content/mathml/content/src/nsMathMLElement.cpp index 31055bf5275..34f36854fa8 100644 --- a/content/mathml/content/src/nsMathMLElement.cpp +++ b/content/mathml/content/src/nsMathMLElement.cpp @@ -56,35 +56,14 @@ //---------------------------------------------------------------------- // nsISupports methods: -NS_IMETHODIMP -nsMathMLElement::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - NS_PRECONDITION(aInstancePtr, "null out param"); - - nsresult rv = nsMathMLElementBase::QueryInterface(aIID, aInstancePtr); - - if (NS_SUCCEEDED(rv)) - return rv; - - nsISupports *inst = nsnull; - - if (aIID.Equals(NS_GET_IID(nsIDOMNode))) { - inst = static_cast(this); - } else if (aIID.Equals(NS_GET_IID(nsIDOMElement))) { - inst = static_cast(this); - } else if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { - inst = NS_GetDOMClassInfoInstance(eDOMClassInfo_Element_id); - NS_ENSURE_TRUE(inst, NS_ERROR_OUT_OF_MEMORY); - } else { - return PostQueryInterface(aIID, aInstancePtr); - } - - NS_ADDREF(inst); - - *aInstancePtr = inst; - - return NS_OK; -} +NS_INTERFACE_TABLE_HEAD(nsMathMLElement) + NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsMathMLElement) + NS_INTERFACE_TABLE_ENTRY(nsMathMLElement, nsIDOMNode) + NS_INTERFACE_TABLE_ENTRY(nsMathMLElement, nsIDOMElement) + NS_OFFSET_AND_INTERFACE_TABLE_END + NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE + NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(MathMLElement) +NS_ELEMENT_INTERFACE_MAP_END NS_IMPL_ADDREF_INHERITED(nsMathMLElement, nsMathMLElementBase) NS_IMPL_RELEASE_INHERITED(nsMathMLElement, nsMathMLElementBase) diff --git a/dom/public/nsDOMClassInfoID.h b/dom/public/nsDOMClassInfoID.h index 89e37611352..a5258e57d46 100644 --- a/dom/public/nsDOMClassInfoID.h +++ b/dom/public/nsDOMClassInfoID.h @@ -454,6 +454,10 @@ enum nsDOMClassInfoID { eDOMClassInfo_SimpleGestureEvent_id, +#ifdef MOZ_MATHML + eDOMClassInfo_MathMLElement_id, +#endif + // This one better be the last one in this list eDOMClassInfoIDCount }; diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 85f435a6ab2..eac4da28c2f 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -1299,6 +1299,11 @@ static nsDOMClassInfoData sClassInfoData[] = { NS_DEFINE_CLASSINFO_DATA(SimpleGestureEvent, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) + +#ifdef MOZ_MATHML + NS_DEFINE_CLASSINFO_DATA_WITH_NAME(MathMLElement, Element, nsElementSH, + ELEMENT_SCRIPTABLE_FLAGS) +#endif }; // Objects that shuld be constructable through |new Name();| @@ -3542,6 +3547,16 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END +#ifdef MOZ_MATHML + DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(MathMLElement, nsIDOMElement) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMElement) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) + DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector) + DOM_CLASSINFO_MAP_END +#endif + #ifdef NS_DEBUG { PRUint32 i = NS_ARRAY_LENGTH(sClassInfoData);