added inline style sheet accessor

git-svn-id: svn://10.0.0.236/trunk@15581 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterl%netscape.com
1998-12-02 00:35:41 +00:00
parent c57d0b3d20
commit 69b84cb501
6 changed files with 38 additions and 0 deletions

View File

@@ -367,6 +367,22 @@ NS_IMETHODIMP nsHTMLDocument::GetAttributeStyleSheet(nsIHTMLStyleSheet** aResult
return NS_OK;
}
NS_IMETHODIMP nsHTMLDocument::GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aResult)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
if (nsnull == aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = mStyleAttrStyleSheet;
if (nsnull == mStyleAttrStyleSheet) {
return NS_ERROR_NOT_AVAILABLE; // probably not the right error...
}
else {
NS_ADDREF(mStyleAttrStyleSheet);
}
return NS_OK;
}
void nsHTMLDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet)
{
if ((nsnull != mStyleAttrStyleSheet) && (aSheet != mStyleAttrStyleSheet)) {

View File

@@ -56,6 +56,7 @@ public:
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult);
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet);
NS_IMETHOD GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aStyleSheet);
NS_IMETHOD GetDTDMode(nsDTDMode& aMode);
NS_IMETHOD SetDTDMode(nsDTDMode aMode);

View File

@@ -21,6 +21,7 @@
#include "nsISupports.h"
class nsIHTMLStyleSheet;
class nsIHTMLCSSStyleSheet;
/* a6cf90cc-15b3-11d2-932e-00805f8add32 */
#define NS_IHTMLCONTENTCONTAINER_IID \
@@ -35,6 +36,7 @@ class nsIHTMLStyleSheet;
class nsIHTMLContentContainer : public nsISupports {
public:
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet) = 0;
NS_IMETHOD GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aStyleSheet) = 0;
};

View File

@@ -367,6 +367,22 @@ NS_IMETHODIMP nsHTMLDocument::GetAttributeStyleSheet(nsIHTMLStyleSheet** aResult
return NS_OK;
}
NS_IMETHODIMP nsHTMLDocument::GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aResult)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
if (nsnull == aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = mStyleAttrStyleSheet;
if (nsnull == mStyleAttrStyleSheet) {
return NS_ERROR_NOT_AVAILABLE; // probably not the right error...
}
else {
NS_ADDREF(mStyleAttrStyleSheet);
}
return NS_OK;
}
void nsHTMLDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet)
{
if ((nsnull != mStyleAttrStyleSheet) && (aSheet != mStyleAttrStyleSheet)) {

View File

@@ -56,6 +56,7 @@ public:
NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult);
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet);
NS_IMETHOD GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aStyleSheet);
NS_IMETHOD GetDTDMode(nsDTDMode& aMode);
NS_IMETHOD SetDTDMode(nsDTDMode aMode);

View File

@@ -21,6 +21,7 @@
#include "nsISupports.h"
class nsIHTMLStyleSheet;
class nsIHTMLCSSStyleSheet;
/* a6cf90cc-15b3-11d2-932e-00805f8add32 */
#define NS_IHTMLCONTENTCONTAINER_IID \
@@ -35,6 +36,7 @@ class nsIHTMLStyleSheet;
class nsIHTMLContentContainer : public nsISupports {
public:
NS_IMETHOD GetAttributeStyleSheet(nsIHTMLStyleSheet** aStyleSheet) = 0;
NS_IMETHOD GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aStyleSheet) = 0;
};