Adding support for other backstop style sheets.

git-svn-id: svn://10.0.0.236/trunk@67584 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com 2000-04-28 23:32:51 +00:00
parent f120d8187f
commit 283f4ca371
3 changed files with 51 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include "nsIPresShell.h"
#include "nsIStyleSet.h"
#include "nsIStyleSheet.h"
#include "nsICSSStyleSheet.h"
#include "nsIStyleContext.h"
#include "nsIFrame.h"
@ -73,6 +74,7 @@
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsIChromeRegistry.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
@ -950,6 +952,21 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
if (mUAStyleSheet) {
(*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet);
}
NS_WITH_SERVICE(nsIChromeRegistry, chromeRegistry, "component://netscape/chrome/chrome-registry", &rv);
if (NS_SUCCEEDED(rv) && chromeRegistry) {
nsCOMPtr<nsISupportsArray> sheets;
chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets));
if(sheets){
nsCOMPtr<nsICSSStyleSheet> sheet;
PRUint32 count;
sheets->Count(&count);
for(PRUint32 i=0; i<count; i++) {
sheets->GetElementAt(i, getter_AddRefs(sheet));
(*aStyleSet)->AppendBackstopStyleSheet(sheet);
}
}
}
}
return rv;
}

View File

@ -37,6 +37,7 @@
#include "nsIPresShell.h"
#include "nsIStyleSet.h"
#include "nsIStyleSheet.h"
#include "nsICSSStyleSheet.h"
#include "nsIStyleContext.h"
#include "nsIFrame.h"
@ -73,6 +74,7 @@
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsIChromeRegistry.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
@ -950,6 +952,21 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
if (mUAStyleSheet) {
(*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet);
}
NS_WITH_SERVICE(nsIChromeRegistry, chromeRegistry, "component://netscape/chrome/chrome-registry", &rv);
if (NS_SUCCEEDED(rv) && chromeRegistry) {
nsCOMPtr<nsISupportsArray> sheets;
chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets));
if(sheets){
nsCOMPtr<nsICSSStyleSheet> sheet;
PRUint32 count;
sheets->Count(&count);
for(PRUint32 i=0; i<count; i++) {
sheets->GetElementAt(i, getter_AddRefs(sheet));
(*aStyleSet)->AppendBackstopStyleSheet(sheet);
}
}
}
}
return rv;
}

View File

@ -37,6 +37,7 @@
#include "nsIPresShell.h"
#include "nsIStyleSet.h"
#include "nsIStyleSheet.h"
#include "nsICSSStyleSheet.h"
#include "nsIStyleContext.h"
#include "nsIFrame.h"
@ -73,6 +74,7 @@
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsIChromeRegistry.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
@ -950,6 +952,21 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
if (mUAStyleSheet) {
(*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet);
}
NS_WITH_SERVICE(nsIChromeRegistry, chromeRegistry, "component://netscape/chrome/chrome-registry", &rv);
if (NS_SUCCEEDED(rv) && chromeRegistry) {
nsCOMPtr<nsISupportsArray> sheets;
chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets));
if(sheets){
nsCOMPtr<nsICSSStyleSheet> sheet;
PRUint32 count;
sheets->Count(&count);
for(PRUint32 i=0; i<count; i++) {
sheets->GetElementAt(i, getter_AddRefs(sheet));
(*aStyleSet)->AppendBackstopStyleSheet(sheet);
}
}
}
}
return rv;
}