Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
txTransformNotifier Class Reference

#include <txMozillaXMLOutput.h>

Inheritance diagram for txTransformNotifier:
Inheritance graph
[legend]
Collaboration diagram for txTransformNotifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 txTransformNotifier ()
virtual ~txTransformNotifier ()
NS_DECL_ISUPPORTS
NS_DECL_NSISCRIPTLOADEROBSERVER
NS_IMETHOD 
StyleSheetLoaded (nsICSSStyleSheet *aSheet, PRBool aNotify)
void Init (nsITransformObserver *aObserver)
void AddScriptElement (nsIScriptElement *aElement)
void AddStyleSheet (nsIStyleSheet *aStyleSheet)
void OnTransformEnd (nsresult aResult=NS_OK)
void OnTransformStart ()
void SetOutputDocument (nsIDOMDocument *aDocument)
void scriptAvailable (in nsresult aResult, in nsIScriptElement aElement, in boolean aIsInline, in boolean aWasPending, in nsIURI aURI, in PRInt32 aLineNo, in AString aScript)
 The script is available for evaluation.
void scriptEvaluated (in nsresult aResult, in nsIScriptElement aElement, in boolean aIsInline, in boolean aWasPending)
 The script has been evaluated.

Private Member Functions

void SignalTransformEnd (nsresult aResult=NS_OK)

Private Attributes

nsCOMPtr< nsIDOMDocumentmDocument
nsCOMPtr< nsITransformObservermObserver
nsCOMArray< nsIScriptElementmScriptElements
nsCOMArray< nsIStyleSheetmStylesheets
PRPackedBool mInTransform

Detailed Description

Definition at line 59 of file txMozillaXMLOutput.h.


Constructor & Destructor Documentation

Definition at line 838 of file txMozillaXMLOutput.cpp.

Definition at line 844 of file txMozillaXMLOutput.cpp.

{
}

Member Function Documentation

Definition at line 904 of file txMozillaXMLOutput.cpp.

Here is the call graph for this function:

Definition at line 910 of file txMozillaXMLOutput.cpp.

{
    mStylesheets.AppendObject(aStyleSheet);
}

Here is the call graph for this function:

Definition at line 898 of file txMozillaXMLOutput.cpp.

{
    mObserver = aObserver;
}

Definition at line 916 of file txMozillaXMLOutput.cpp.

Here is the call graph for this function:

Definition at line 923 of file txMozillaXMLOutput.cpp.

void nsIScriptLoaderObserver::scriptAvailable ( in nsresult  aResult,
in nsIScriptElement  aElement,
in boolean  aIsInline,
in boolean  aWasPending,
in nsIURI  aURI,
in PRInt32  aLineNo,
in AString  aScript 
) [inherited]

The script is available for evaluation.

For inline scripts, this method will be called synchronously. For externally loaded scripts, this method will be called when the load completes.

Parameters:
aResultA result code representing the result of loading a script. If this is a failure code, script evaluation will not occur.
aElementThe element being processed.
aIsInlineIs this an inline script or externally loaded?
aWasPendingDid script processing have to be delayed, either for loading of an external script or because processing of an earlier scheduled script was delayed?
aURIWhat is the URI of the script (the document URI if it is inline).
aLineNoAt what line does the script appear (generally 1 if it is a loaded script).
aScriptString representation of the string to be evaluated.
void nsIScriptLoaderObserver::scriptEvaluated ( in nsresult  aResult,
in nsIScriptElement  aElement,
in boolean  aIsInline,
in boolean  aWasPending 
) [inherited]

The script has been evaluated.

Parameters:
aResultA result code representing the success or failure of the script evaluation.
aElementThe element being processed.
aIsInlineIs this an inline script or externally loaded?
aWasPendingDid script processing have to be delayed, either for loading of an external script or because processing of an earlier scheduled script was delayed?

Definition at line 929 of file txMozillaXMLOutput.cpp.

{
    mDocument = aDocument;

    // Notify the contentsink that the document is created
    mObserver->OnDocumentCreated(mDocument);
}

Definition at line 938 of file txMozillaXMLOutput.cpp.

{
    if (mInTransform || (NS_SUCCEEDED(aResult) &&
        mScriptElements.Count() > 0 || mStylesheets.Count() > 0)) {
        return;
    }

    mStylesheets.Clear();
    mScriptElements.Clear();

    // Make sure that we don't get deleted while this function is executed and
    // we remove ourselfs from the scriptloader
    nsCOMPtr<nsIScriptLoaderObserver> kungFuDeathGrip(this);

    nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
    if (doc) {
        nsIScriptLoader *scriptLoader = doc->GetScriptLoader();
        if (scriptLoader) {
            scriptLoader->RemoveObserver(this);
            // XXX Maybe we want to cancel script loads if NS_FAILED(rv)?
        }

        if (NS_FAILED(aResult)) {
            doc->CSSLoader()->Stop();
        }
    }

    if (NS_SUCCEEDED(aResult)) {
        mObserver->OnTransformDone(aResult, mDocument);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsICSSLoaderObserver.

Definition at line 883 of file txMozillaXMLOutput.cpp.

{
    // Check that the stylesheet was in the mStylesheets array, if not it is an
    // alternate and we don't want to call SignalTransformEnd since we don't
    // wait on alternates before calling OnTransformDone and so the load of the
    // alternate could finish after we called OnTransformDone already.
    // See http://bugzilla.mozilla.org/show_bug.cgi?id=215465.
    if (mStylesheets.RemoveObject(aSheet)) {
        SignalTransformEnd();
    }

    return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 82 of file txMozillaXMLOutput.h.

Definition at line 86 of file txMozillaXMLOutput.h.

Definition at line 83 of file txMozillaXMLOutput.h.

Definition at line 84 of file txMozillaXMLOutput.h.

Definition at line 85 of file txMozillaXMLOutput.h.


The documentation for this class was generated from the following files: