diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index 3ff0553b784..f2d852efcc4 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -42,7 +42,7 @@ #include "nsWeakReference.h" #include "nsWeakPtr.h" #include "nsVoidArray.h" -#include "nsIDOMDocument.h" +#include "nsIDOMXMLDocument.h" #include "nsIDOMDocumentView.h" #include "nsIDOMDocumentXBL.h" #include "nsIDOMNSDocument.h" @@ -212,9 +212,17 @@ protected: void* mScriptObject; }; -// Base class for our document implementations +// Base class for our document implementations. +// +// Note that this class *implements* nsIDOMXMLDocument, but it's not +// really an nsIDOMXMLDocument. The reason for implementing +// nsIDOMXMLDocument on this class is to avoid having to duplicate all +// its inherited methods on document classes that *are* +// nsIDOMXMLDocument's. nsDocument's QI should *not* claim to support +// nsIDOMXMLDocument unless someone writes a real implementation of +// the interface. class nsDocument : public nsIDocument, - public nsIDOMDocument, + public nsIDOMXMLDocument, // inherits nsIDOMDocument public nsIDOMNSDocument, public nsIDOMDocumentEvent, public nsIDOMDocumentStyle, @@ -489,6 +497,9 @@ public: // nsIDOMDocument NS_DECL_NSIDOMDOCUMENT + // nsIDOMXMLDocument + NS_DECL_NSIDOMXMLDOCUMENT + // nsIDOMNSDocument NS_DECL_NSIDOMNSDOCUMENT diff --git a/content/xml/document/src/nsXMLDocument.h b/content/xml/document/src/nsXMLDocument.h index 3867b2f61b8..7e4748adeeb 100644 --- a/content/xml/document/src/nsXMLDocument.h +++ b/content/xml/document/src/nsXMLDocument.h @@ -56,8 +56,7 @@ class nsXMLDocument : public nsMarkupDocument, public nsIXMLDocument, public nsIHTMLContentContainer, public nsIInterfaceRequestor, - public nsIHttpEventSink, - public nsIDOMXMLDocument + public nsIHttpEventSink { public: nsXMLDocument(); diff --git a/dom/public/idl/core/nsIDOMXMLDocument.idl b/dom/public/idl/core/nsIDOMXMLDocument.idl index b92dddec1e5..adcdc2894a6 100644 --- a/dom/public/idl/core/nsIDOMXMLDocument.idl +++ b/dom/public/idl/core/nsIDOMXMLDocument.idl @@ -37,10 +37,10 @@ * * ***** END LICENSE BLOCK ***** */ -#include "domstubs.idl" +#include "nsIDOMDocument.idl" [scriptable, uuid(8816d003-e7c8-4065-8827-829b8d07b6e0)] -interface nsIDOMXMLDocument : nsISupports +interface nsIDOMXMLDocument : nsIDOMDocument { void load(in DOMString url); }; diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 651d0af83bf..e87aea59a04 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -987,7 +987,7 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMScreen) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(XMLDocument, nsIDOMDocument) + DOM_CLASSINFO_MAP_BEGIN(XMLDocument, nsIDOMXMLDocument) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocument) DOM_CLASSINFO_MAP_ENTRY(nsIDOMXMLDocument) DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument)