diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 3757679721c..6d49d3f6a70 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -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)) { diff --git a/mozilla/content/html/document/src/nsHTMLDocument.h b/mozilla/content/html/document/src/nsHTMLDocument.h index 5b3aaba3be3..b9765643a30 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.h +++ b/mozilla/content/html/document/src/nsHTMLDocument.h @@ -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); diff --git a/mozilla/content/html/document/src/nsIHTMLContentContainer.h b/mozilla/content/html/document/src/nsIHTMLContentContainer.h index 14faf896ea6..489d1a73217 100644 --- a/mozilla/content/html/document/src/nsIHTMLContentContainer.h +++ b/mozilla/content/html/document/src/nsIHTMLContentContainer.h @@ -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; }; diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index 3757679721c..6d49d3f6a70 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -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)) { diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.h b/mozilla/layout/html/document/src/nsHTMLDocument.h index 5b3aaba3be3..b9765643a30 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.h +++ b/mozilla/layout/html/document/src/nsHTMLDocument.h @@ -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); diff --git a/mozilla/layout/html/document/src/nsIHTMLContentContainer.h b/mozilla/layout/html/document/src/nsIHTMLContentContainer.h index 14faf896ea6..489d1a73217 100644 --- a/mozilla/layout/html/document/src/nsIHTMLContentContainer.h +++ b/mozilla/layout/html/document/src/nsIHTMLContentContainer.h @@ -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; };