diff --git a/dom/xslt/xpath/XPathEvaluator.cpp b/dom/xslt/xpath/XPathEvaluator.cpp index 5f53c9aac8c..44a451c370c 100644 --- a/dom/xslt/xpath/XPathEvaluator.cpp +++ b/dom/xslt/xpath/XPathEvaluator.cpp @@ -20,6 +20,7 @@ #include "nsDOMString.h" #include "nsNameSpaceManager.h" #include "nsContentUtils.h" +#include "txIXPathContext.h" #include "mozilla/dom/XPathEvaluatorBinding.h" #include "mozilla/dom/BindingUtils.h" diff --git a/dom/xslt/xpath/XPathExpression.cpp b/dom/xslt/xpath/XPathExpression.cpp index 7aa2f5cf9af..9448f942a37 100644 --- a/dom/xslt/xpath/XPathExpression.cpp +++ b/dom/xslt/xpath/XPathExpression.cpp @@ -22,6 +22,35 @@ DOMCI_DATA(XPathExpression, mozilla::dom::XPathExpression) namespace mozilla { namespace dom { +class EvalContextImpl : public txIEvalContext +{ +public: + EvalContextImpl(const txXPathNode& aContextNode, + uint32_t aContextPosition, uint32_t aContextSize, + txResultRecycler* aRecycler) + : mContextNode(aContextNode), + mContextPosition(aContextPosition), + mContextSize(aContextSize), + mLastError(NS_OK), + mRecycler(aRecycler) + { + } + + nsresult getError() + { + return mLastError; + } + + TX_DECL_EVAL_CONTEXT; + +private: + const txXPathNode& mContextNode; + uint32_t mContextPosition; + uint32_t mContextSize; + nsresult mLastError; + nsRefPtr mRecycler; +}; + NS_IMPL_CYCLE_COLLECTION(XPathExpression, mDocument) NS_IMPL_CYCLE_COLLECTING_ADDREF(XPathExpression) @@ -157,55 +186,54 @@ XPathExpression::EvaluateWithContext(nsIDOMNode *aContextNode, */ nsresult -XPathExpression::EvalContextImpl::getVariable(int32_t aNamespace, - nsIAtom* aLName, - txAExprResult*& aResult) +EvalContextImpl::getVariable(int32_t aNamespace, + nsIAtom* aLName, + txAExprResult*& aResult) { aResult = 0; return NS_ERROR_INVALID_ARG; } bool -XPathExpression::EvalContextImpl::isStripSpaceAllowed(const txXPathNode& aNode) +EvalContextImpl::isStripSpaceAllowed(const txXPathNode& aNode) { return false; } void* -XPathExpression::EvalContextImpl::getPrivateContext() +EvalContextImpl::getPrivateContext() { // we don't have a private context here. return nullptr; } txResultRecycler* -XPathExpression::EvalContextImpl::recycler() +EvalContextImpl::recycler() { return mRecycler; } void -XPathExpression::EvalContextImpl::receiveError(const nsAString& aMsg, - nsresult aRes) +EvalContextImpl::receiveError(const nsAString& aMsg, nsresult aRes) { mLastError = aRes; // forward aMsg to console service? } const txXPathNode& -XPathExpression::EvalContextImpl::getContextNode() +EvalContextImpl::getContextNode() { return mContextNode; } uint32_t -XPathExpression::EvalContextImpl::size() +EvalContextImpl::size() { return mContextSize; } uint32_t -XPathExpression::EvalContextImpl::position() +EvalContextImpl::position() { return mContextPosition; } diff --git a/dom/xslt/xpath/XPathExpression.h b/dom/xslt/xpath/XPathExpression.h index a7e5c4ec000..24cf658074f 100644 --- a/dom/xslt/xpath/XPathExpression.h +++ b/dom/xslt/xpath/XPathExpression.h @@ -8,7 +8,6 @@ #include "nsIDOMXPathExpression.h" #include "nsIDOMNSXPathExpression.h" -#include "txIXPathContext.h" #include "txResultRecycler.h" #include "nsAutoPtr.h" #include "nsCycleCollectionParticipant.h" @@ -47,35 +46,6 @@ private: nsAutoPtr mExpression; nsRefPtr mRecycler; nsCOMPtr mDocument; - - class EvalContextImpl : public txIEvalContext - { - public: - EvalContextImpl(const txXPathNode& aContextNode, - uint32_t aContextPosition, uint32_t aContextSize, - txResultRecycler* aRecycler) - : mContextNode(aContextNode), - mContextPosition(aContextPosition), - mContextSize(aContextSize), - mLastError(NS_OK), - mRecycler(aRecycler) - { - } - - nsresult getError() - { - return mLastError; - } - - TX_DECL_EVAL_CONTEXT; - - private: - const txXPathNode& mContextNode; - uint32_t mContextPosition; - uint32_t mContextSize; - nsresult mLastError; - nsRefPtr mRecycler; - }; }; } // namespace dom