1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "txIXPathContext.h"
9 #include "txXPathTreeWalker.h"
12 * Evaluates this Expr based on the given context node and processor state
13 * @param context the context node for evaluation of this Expr
14 * @param ps the ContextState containing the stack information needed
16 * @return the result of the evaluation
18 nsresult
RootExpr::evaluate(txIEvalContext
* aContext
, txAExprResult
** aResult
) {
19 txXPathTreeWalker
walker(aContext
->getContextNode());
22 return aContext
->recycler()->getNodeSet(walker
.getCurrentPosition(), aResult
);
25 TX_IMPL_EXPR_STUBS_0(RootExpr
, NODESET_RESULT
)
27 bool RootExpr::isSensitiveTo(ContextSensitivity aContext
) {
28 return !!(aContext
& NODE_CONTEXT
);
32 void RootExpr::toString(nsAString
& dest
) {
33 if (mSerialize
) dest
.Append(char16_t('/'));