added accessor for html style sheet

This commit is contained in:
peterl%netscape.com 1998-07-25 01:26:12 +00:00
parent ea6809a628
commit 8cae022e89
6 changed files with 38 additions and 0 deletions

View File

@ -266,6 +266,20 @@ NS_IMETHODIMP nsHTMLDocument::GetImageMap(const nsString& aMapName,
return 1;/* XXX NS_NOT_FOUND */
}
NS_IMETHODIMP nsHTMLDocument::GetAttributeStyleSheet(nsIHTMLStyleSheet** aResult)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
if (nsnull == aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = mAttrStyleSheet;
if (nsnull == mAttrStyleSheet) {
return NS_ERROR_NOT_AVAILABLE; // probably not the right error...
}
return NS_OK;
}
void nsHTMLDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet)
{
if ((nsnull != mAttrStyleSheet) && (aSheet != mAttrStyleSheet)) {

View File

@ -50,6 +50,8 @@ public:
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult);
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet);
// nsIDOMDocument interface
NS_IMETHOD GetMasterDoc(nsIDOMDocument **aDocument)
{ return nsDocument::GetMasterDoc(aDocument); }

View File

@ -21,6 +21,7 @@
#include "nsISupports.h"
class nsIImageMap;
class nsString;
class nsIHTMLStyleSheet;
/* b2a848b0-d0a9-11d1-89b1-006008911b81 */
#define NS_IHTMLDOCUMENT_IID \
@ -36,6 +37,8 @@ public:
NS_IMETHOD AddImageMap(nsIImageMap* aMap) = 0;
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult) = 0;
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet) = 0;
};
#endif /* nsIHTMLDocument_h___ */

View File

@ -266,6 +266,20 @@ NS_IMETHODIMP nsHTMLDocument::GetImageMap(const nsString& aMapName,
return 1;/* XXX NS_NOT_FOUND */
}
NS_IMETHODIMP nsHTMLDocument::GetAttributeStyleSheet(nsIHTMLStyleSheet** aResult)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
if (nsnull == aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = mAttrStyleSheet;
if (nsnull == mAttrStyleSheet) {
return NS_ERROR_NOT_AVAILABLE; // probably not the right error...
}
return NS_OK;
}
void nsHTMLDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet)
{
if ((nsnull != mAttrStyleSheet) && (aSheet != mAttrStyleSheet)) {

View File

@ -50,6 +50,8 @@ public:
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult);
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet);
// nsIDOMDocument interface
NS_IMETHOD GetMasterDoc(nsIDOMDocument **aDocument)
{ return nsDocument::GetMasterDoc(aDocument); }

View File

@ -21,6 +21,7 @@
#include "nsISupports.h"
class nsIImageMap;
class nsString;
class nsIHTMLStyleSheet;
/* b2a848b0-d0a9-11d1-89b1-006008911b81 */
#define NS_IHTMLDOCUMENT_IID \
@ -36,6 +37,8 @@ public:
NS_IMETHOD AddImageMap(nsIImageMap* aMap) = 0;
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult) = 0;
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet) = 0;
};
#endif /* nsIHTMLDocument_h___ */