From 283f4ca3710bfc2120fbbedab497bbadd7a4ac8d Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 28 Apr 2000 23:32:51 +0000 Subject: [PATCH] Adding support for other backstop style sheets. git-svn-id: svn://10.0.0.236/trunk@67584 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocumentViewer.cpp | 17 +++++++++++++++++ mozilla/layout/base/nsDocumentViewer.cpp | 17 +++++++++++++++++ mozilla/layout/base/src/nsDocumentViewer.cpp | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 780485490ac..fd2043c708d 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -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 sheets; + chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets)); + if(sheets){ + nsCOMPtr sheet; + PRUint32 count; + sheets->Count(&count); + for(PRUint32 i=0; iGetElementAt(i, getter_AddRefs(sheet)); + (*aStyleSet)->AppendBackstopStyleSheet(sheet); + } + } + } } return rv; } diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 780485490ac..fd2043c708d 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -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 sheets; + chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets)); + if(sheets){ + nsCOMPtr sheet; + PRUint32 count; + sheets->Count(&count); + for(PRUint32 i=0; iGetElementAt(i, getter_AddRefs(sheet)); + (*aStyleSet)->AppendBackstopStyleSheet(sheet); + } + } + } } return rv; } diff --git a/mozilla/layout/base/src/nsDocumentViewer.cpp b/mozilla/layout/base/src/nsDocumentViewer.cpp index 780485490ac..fd2043c708d 100644 --- a/mozilla/layout/base/src/nsDocumentViewer.cpp +++ b/mozilla/layout/base/src/nsDocumentViewer.cpp @@ -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 sheets; + chromeRegistry->GetBackstopSheets(getter_AddRefs(sheets)); + if(sheets){ + nsCOMPtr sheet; + PRUint32 count; + sheets->Count(&count); + for(PRUint32 i=0; iGetElementAt(i, getter_AddRefs(sheet)); + (*aStyleSet)->AppendBackstopStyleSheet(sheet); + } + } + } } return rv; }