From eac829cd2472a384d41a2b59dbcea029820c1c1f Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sun, 16 May 1999 08:05:32 +0000 Subject: [PATCH] Added the method that will give me the new popup doc. --- content/xul/document/src/nsXULDocument.cpp | 12 +++++++++++- rdf/content/public/nsIXULParentDocument.h | 4 ++++ rdf/content/src/nsXULDocument.cpp | 12 +++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 4d993f0e0a7..df947aeb3cc 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -614,6 +614,7 @@ public: // nsIXULParentDocument interface NS_IMETHOD GetContentViewerContainer(nsIContentViewerContainer** aContainer); NS_IMETHOD GetCommand(nsString& aCommand); + NS_IMETHOD CreatePopupDocument(nsIDOMElement* aPopupElement, nsIDocument** aResult); // nsIXULChildDocument Interface NS_IMETHOD SetFragmentRoot(nsIRDFResource* aFragmentRoot); @@ -749,7 +750,7 @@ protected: nsString mCommand; nsIRDFResource* mFragmentRoot; // [OWNER] nsVoidArray mSubDocuments; // [OWNER] of subelements - nsIDOMElement* mPopup; // [OWNER] of this popup element in the doc + nsIDOMElement* mPopup; // [OWNER] of this popup element in the doc }; PRInt32 XULDocumentImpl::gRefCnt = 0; @@ -2873,6 +2874,15 @@ XULDocumentImpl::GetCommand(nsString& aCommand) return NS_OK; } + +NS_IMETHODIMP +XULDocumentImpl::CreatePopupDocument(nsIDOMElement* aPopupElement, nsIDocument** aResult) +{ + *aResult = this; + NS_ADDREF(*aResult); + return NS_OK; +} + //////////////////////////////////////////////////////////////////////// // nsIXULChildDocument interface NS_IMETHODIMP diff --git a/rdf/content/public/nsIXULParentDocument.h b/rdf/content/public/nsIXULParentDocument.h index e0769576ce0..2ab69d1c2a7 100644 --- a/rdf/content/public/nsIXULParentDocument.h +++ b/rdf/content/public/nsIXULParentDocument.h @@ -31,8 +31,12 @@ class nsIXULParentDocument: public nsISupports { public: static const nsIID& GetIID() { static nsIID iid = NS_IXULPARENTDOCUMENT_IID; return iid; } + // Used for XUL fragment child documents NS_IMETHOD GetContentViewerContainer(nsIContentViewerContainer** aContainer) = 0; NS_IMETHOD GetCommand(nsString& aCommand) = 0; + + // Used for XUL popup child documents + NS_IMETHOD CreatePopupDocument(nsIDOMElement* aPopupElement, nsIDocument** aResult) = 0; }; #endif // nsIXULParentDocument_h__ diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index 4d993f0e0a7..df947aeb3cc 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -614,6 +614,7 @@ public: // nsIXULParentDocument interface NS_IMETHOD GetContentViewerContainer(nsIContentViewerContainer** aContainer); NS_IMETHOD GetCommand(nsString& aCommand); + NS_IMETHOD CreatePopupDocument(nsIDOMElement* aPopupElement, nsIDocument** aResult); // nsIXULChildDocument Interface NS_IMETHOD SetFragmentRoot(nsIRDFResource* aFragmentRoot); @@ -749,7 +750,7 @@ protected: nsString mCommand; nsIRDFResource* mFragmentRoot; // [OWNER] nsVoidArray mSubDocuments; // [OWNER] of subelements - nsIDOMElement* mPopup; // [OWNER] of this popup element in the doc + nsIDOMElement* mPopup; // [OWNER] of this popup element in the doc }; PRInt32 XULDocumentImpl::gRefCnt = 0; @@ -2873,6 +2874,15 @@ XULDocumentImpl::GetCommand(nsString& aCommand) return NS_OK; } + +NS_IMETHODIMP +XULDocumentImpl::CreatePopupDocument(nsIDOMElement* aPopupElement, nsIDocument** aResult) +{ + *aResult = this; + NS_ADDREF(*aResult); + return NS_OK; +} + //////////////////////////////////////////////////////////////////////// // nsIXULChildDocument interface NS_IMETHODIMP