mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Fix the reviewcomments from bug 342274, r/sr=peterv
This commit is contained in:
parent
172c19319f
commit
18d1b545da
@ -40,16 +40,16 @@
|
||||
[scriptable, uuid(b8d727f7-67f4-4dc1-a318-ec0c87280816)]
|
||||
interface nsIXSLTProcessorPrivate : nsISupports
|
||||
{
|
||||
/**
|
||||
* Disables all loading of external documents, such as from
|
||||
* <xsl:import> and document()
|
||||
* Defaults to off and is *not* reset by calls to reset()
|
||||
*/
|
||||
const unsigned long DISABLE_ALL_LOADS = 1;
|
||||
/**
|
||||
* Disables all loading of external documents, such as from
|
||||
* <xsl:import> and document()
|
||||
* Defaults to off and is *not* reset by calls to reset()
|
||||
*/
|
||||
const unsigned long DISABLE_ALL_LOADS = 1;
|
||||
|
||||
/**
|
||||
* Flags for this processor. Defaults to 0. See individual flags above
|
||||
* for documentation for effect of reset()
|
||||
*/
|
||||
attribute unsigned long flags;
|
||||
attribute unsigned long flags;
|
||||
};
|
||||
|
@ -511,7 +511,7 @@ txCompileObserver::loadURI(const nsAString& aUri,
|
||||
const nsAString& aReferrerUri,
|
||||
txStylesheetCompiler* aCompiler)
|
||||
{
|
||||
if (mProcessor->DisableLoads()) {
|
||||
if (mProcessor->IsLoadDisabled()) {
|
||||
return NS_ERROR_XSLT_LOAD_BLOCKED_ERROR;
|
||||
}
|
||||
|
||||
@ -705,7 +705,7 @@ public:
|
||||
TX_DECL_ACOMPILEOBSERVER;
|
||||
|
||||
protected:
|
||||
txMozillaXSLTProcessor* mProcessor;
|
||||
nsRefPtr<txMozillaXSLTProcessor> mProcessor;
|
||||
nsAutoRefCnt mRefCnt;
|
||||
};
|
||||
|
||||
@ -740,7 +740,7 @@ txSyncCompileObserver::loadURI(const nsAString& aUri,
|
||||
const nsAString& aReferrerUri,
|
||||
txStylesheetCompiler* aCompiler)
|
||||
{
|
||||
if (mProcessor->DisableLoads()) {
|
||||
if (mProcessor->IsLoadDisabled()) {
|
||||
return NS_ERROR_XSLT_LOAD_BLOCKED_ERROR;
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,8 @@ txMozillaXSLTProcessor::TransformDocument(nsIDOMNode* aSourceDOM,
|
||||
type == nsIDOMNode::DOCUMENT_NODE,
|
||||
NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsresult rv = TX_CompileStylesheet(aStyleDOM, this, getter_AddRefs(mStylesheet));
|
||||
nsresult rv = TX_CompileStylesheet(aStyleDOM, this,
|
||||
getter_AddRefs(mStylesheet));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mSource = aSourceDOM;
|
||||
@ -596,7 +597,8 @@ txMozillaXSLTProcessor::ImportStylesheet(nsIDOMNode *aStyle)
|
||||
type == nsIDOMNode::DOCUMENT_NODE,
|
||||
NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsresult rv = TX_CompileStylesheet(aStyle, this, getter_AddRefs(mStylesheet));
|
||||
nsresult rv = TX_CompileStylesheet(aStyle, this,
|
||||
getter_AddRefs(mStylesheet));
|
||||
// XXX set up exception context, bug 204658
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@ -654,7 +656,7 @@ txMozillaXSLTProcessor::TransformToDoc(nsIDOMDocument *aOutputDoc,
|
||||
sourceDOMDocument = do_QueryInterface(mSource);
|
||||
}
|
||||
|
||||
txExecutionState es(mStylesheet, DisableLoads());
|
||||
txExecutionState es(mStylesheet, IsLoadDisabled());
|
||||
|
||||
// XXX Need to add error observers
|
||||
|
||||
@ -705,7 +707,7 @@ txMozillaXSLTProcessor::TransformToFragment(nsIDOMNode *aSource,
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
txExecutionState es(mStylesheet, DisableLoads());
|
||||
txExecutionState es(mStylesheet, IsLoadDisabled());
|
||||
|
||||
// XXX Need to add error observers
|
||||
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
nsresult TransformToDoc(nsIDOMDocument *aOutputDoc,
|
||||
nsIDOMDocument **aResult);
|
||||
|
||||
PRBool DisableLoads()
|
||||
PRBool IsLoadDisabled()
|
||||
{
|
||||
return (mFlags & DISABLE_ALL_LOADS) != 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user