For bug 17325. Changed signature of css loader methods. R=nisheeth.

This commit is contained in:
vidur%netscape.com 1999-12-04 01:29:18 +00:00
Родитель 7261da2144
Коммит a90864f224
13 изменённых файлов: 51 добавлений и 21 удалений

Просмотреть файл

@ -1013,7 +1013,8 @@ nsChromeRegistry::ProcessStyleSheet(nsIURL* aURL, nsICSSLoader* aLoader, nsIDocu
kNameSpaceID_Unknown,
aDocument->GetNumberOfStyleSheets(),
nsnull,
doneLoading); // Ignore doneLoading. Don't care.
doneLoading, // Ignore doneLoading. Don't care.
nsnull);
return rv;
}

Просмотреть файл

@ -1271,8 +1271,8 @@ nsXMLContentSink::ProcessCSSStyleLink(nsIContent* aElement,
PRBool doneLoading;
result = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,
mStyleSheetCount++,
((blockParser) ? mParser : nsnull),
doneLoading);
((blockParser) ? mParser : nsnull),
doneLoading, nsnull);
NS_RELEASE(url);
if (NS_SUCCEEDED(result) && blockParser && (! doneLoading)) {
result = NS_ERROR_HTMLPARSER_BLOCK;
@ -1610,7 +1610,7 @@ nsXMLContentSink::StartLayout()
NS_IMETHODIMP
nsXMLContentSink::ResumeParsing()
{
if (nsnull != mParser) {
if (mParser) {
mParser->EnableParser(PR_TRUE);
}

Просмотреть файл

@ -895,7 +895,7 @@ XULContentSinkImpl::ProcessStyleLink(nsIContent* aElement,
rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,
doc->GetNumberOfStyleSheets(),
((blockParser) ? mParser : nsnull),
doneLoading);
doneLoading, nsnull);
if (NS_SUCCEEDED(rv) && blockParser && (! doneLoading)) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
}

Просмотреть файл

@ -947,7 +947,7 @@ nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
// We use null for the callback and data pointer because
// we MUST ONLY load synchronous local files (no @import)
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete, nsnull, nsnull);
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete, nsnull);
if (NS_SUCCEEDED(rv))
{
// Synchronous loads should ALWAYS return completed

Просмотреть файл

@ -351,6 +351,11 @@ NS_IMETHODIMP nsHTMLEditor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICSSLoaderObserver::GetIID())) {
*aInstancePtr = NS_STATIC_CAST(nsICSSLoaderObserver*, this);
NS_ADDREF_THIS();
return NS_OK;
}
return nsEditor::QueryInterface(aIID, aInstancePtr);
}
@ -3029,7 +3034,7 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
// We use null for the callback and data pointer because
// we MUST ONLY load synchronous local files (no @import)
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete,
nsnull, nsnull);
nsnull);
// Synchronous loads should ALWAYS return completed
if (!complete || !cssStyleSheet)
@ -3054,7 +3059,6 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
}
else {
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete,
ApplyStyleSheetToPresShellDocument,
this);
if (NS_SUCCEEDED(rv)) {
@ -4093,6 +4097,12 @@ nsHTMLEditor::ReplaceStyleSheet(nsICSSStyleSheet *aNewSheet)
return rv;
}
NS_IMETHODIMP
nsHTMLEditor::StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify)
{
ApplyStyleSheetToPresShellDocument(aSheet, this);
return NS_OK;
}
/* static callback */
void nsHTMLEditor::ApplyStyleSheetToPresShellDocument(nsICSSStyleSheet* aSheet, void *aData)

Просмотреть файл

@ -34,6 +34,7 @@
#include "nsIDOMElement.h"
#include "nsIDOMEventListener.h"
#include "nsICSSLoader.h"
#include "nsICSSLoaderObserver.h"
#include "nsITableLayout.h"
#include "TypeInState.h"
@ -49,7 +50,8 @@ class nsHTMLEditor : public nsEditor,
public nsIHTMLEditor,
public nsIEditorMailSupport,
public nsITableEditor,
public nsIEditorStyleSheets
public nsIEditorStyleSheets,
public nsICSSLoaderObserver
{
typedef enum {eNoOp, eReplaceParent=1, eInsertParent=2} BlockTransformationType;
@ -221,6 +223,8 @@ public:
NS_IMETHOD DebugUnitTests(PRInt32 *outNumTests, PRInt32 *outNumTestsFailed);
/* ------------ nsICSSLoaderObserver -------------- */
NS_IMETHOD StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify);
/* ------------ Utility Routines, not part of public API -------------- */
NS_IMETHOD GetBodyStyleContext(nsIStyleContext** aStyleContext);

Просмотреть файл

@ -947,7 +947,7 @@ nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
// We use null for the callback and data pointer because
// we MUST ONLY load synchronous local files (no @import)
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete, nsnull, nsnull);
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete, nsnull);
if (NS_SUCCEEDED(rv))
{
// Synchronous loads should ALWAYS return completed

Просмотреть файл

@ -351,6 +351,11 @@ NS_IMETHODIMP nsHTMLEditor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICSSLoaderObserver::GetIID())) {
*aInstancePtr = NS_STATIC_CAST(nsICSSLoaderObserver*, this);
NS_ADDREF_THIS();
return NS_OK;
}
return nsEditor::QueryInterface(aIID, aInstancePtr);
}
@ -3029,7 +3034,7 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
// We use null for the callback and data pointer because
// we MUST ONLY load synchronous local files (no @import)
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete,
nsnull, nsnull);
nsnull);
// Synchronous loads should ALWAYS return completed
if (!complete || !cssStyleSheet)
@ -3054,7 +3059,6 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
}
else {
rv = cssLoader->LoadAgentSheet(uaURL, *getter_AddRefs(cssStyleSheet), complete,
ApplyStyleSheetToPresShellDocument,
this);
if (NS_SUCCEEDED(rv)) {
@ -4093,6 +4097,12 @@ nsHTMLEditor::ReplaceStyleSheet(nsICSSStyleSheet *aNewSheet)
return rv;
}
NS_IMETHODIMP
nsHTMLEditor::StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify)
{
ApplyStyleSheetToPresShellDocument(aSheet, this);
return NS_OK;
}
/* static callback */
void nsHTMLEditor::ApplyStyleSheetToPresShellDocument(nsICSSStyleSheet* aSheet, void *aData)

Просмотреть файл

@ -34,6 +34,7 @@
#include "nsIDOMElement.h"
#include "nsIDOMEventListener.h"
#include "nsICSSLoader.h"
#include "nsICSSLoaderObserver.h"
#include "nsITableLayout.h"
#include "TypeInState.h"
@ -49,7 +50,8 @@ class nsHTMLEditor : public nsEditor,
public nsIHTMLEditor,
public nsIEditorMailSupport,
public nsITableEditor,
public nsIEditorStyleSheets
public nsIEditorStyleSheets,
public nsICSSLoaderObserver
{
typedef enum {eNoOp, eReplaceParent=1, eInsertParent=2} BlockTransformationType;
@ -221,6 +223,8 @@ public:
NS_IMETHOD DebugUnitTests(PRInt32 *outNumTests, PRInt32 *outNumTestsFailed);
/* ------------ nsICSSLoaderObserver -------------- */
NS_IMETHOD StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify);
/* ------------ Utility Routines, not part of public API -------------- */
NS_IMETHOD GetBodyStyleContext(nsIStyleContext** aStyleContext);

Просмотреть файл

@ -208,7 +208,7 @@ nsLayoutModule::Initialize()
if (cssLoader) {
PRBool complete;
rv = cssLoader->LoadAgentSheet(uaURL, gUAStyleSheet, complete,
nsnull, nsnull);
nsnull);
}
}
if (NS_FAILED(rv)) {

Просмотреть файл

@ -1271,8 +1271,8 @@ nsXMLContentSink::ProcessCSSStyleLink(nsIContent* aElement,
PRBool doneLoading;
result = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,
mStyleSheetCount++,
((blockParser) ? mParser : nsnull),
doneLoading);
((blockParser) ? mParser : nsnull),
doneLoading, nsnull);
NS_RELEASE(url);
if (NS_SUCCEEDED(result) && blockParser && (! doneLoading)) {
result = NS_ERROR_HTMLPARSER_BLOCK;
@ -1610,7 +1610,7 @@ nsXMLContentSink::StartLayout()
NS_IMETHODIMP
nsXMLContentSink::ResumeParsing()
{
if (nsnull != mParser) {
if (mParser) {
mParser->EnableParser(PR_TRUE);
}

Просмотреть файл

@ -1013,7 +1013,8 @@ nsChromeRegistry::ProcessStyleSheet(nsIURL* aURL, nsICSSLoader* aLoader, nsIDocu
kNameSpaceID_Unknown,
aDocument->GetNumberOfStyleSheets(),
nsnull,
doneLoading); // Ignore doneLoading. Don't care.
doneLoading, // Ignore doneLoading. Don't care.
nsnull);
return rv;
}

Просмотреть файл

@ -895,7 +895,7 @@ XULContentSinkImpl::ProcessStyleLink(nsIContent* aElement,
rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,
doc->GetNumberOfStyleSheets(),
((blockParser) ? mParser : nsnull),
doneLoading);
doneLoading, nsnull);
if (NS_SUCCEEDED(rv) && blockParser && (! doneLoading)) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
}