Fix for bug 462929 ("ASSERTION: We can't deal with objects that have the same classinfo but different offset tables" with MathML element and other element). r/sr=jst.

This commit is contained in:
Peter Van der Beken 2008-11-04 18:21:38 +01:00
Родитель bbeaacb82b
Коммит 124b30be15
3 изменённых файлов: 27 добавлений и 29 удалений

Просмотреть файл

@ -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<nsIDOMNode *>(this);
} else if (aIID.Equals(NS_GET_IID(nsIDOMElement))) {
inst = static_cast<nsIDOMElement *>(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)

Просмотреть файл

@ -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
};

Просмотреть файл

@ -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);