Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleh...
[gecko.git] / dom / xslt / xpath / txRootExpr.cpp
blobcabc0e1c13c4eb256ee1219b08a78dcac782ecec
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/. */
6 #include "txExpr.h"
7 #include "txNodeSet.h"
8 #include "txIXPathContext.h"
9 #include "txXPathTreeWalker.h"
11 /**
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
15 * for evaluation
16 * @return the result of the evaluation
17 **/
18 nsresult RootExpr::evaluate(txIEvalContext* aContext, txAExprResult** aResult) {
19 txXPathTreeWalker walker(aContext->getContextNode());
20 walker.moveToRoot();
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);
31 #ifdef TX_TO_STRING
32 void RootExpr::toString(nsAString& dest) {
33 if (mSerialize) dest.Append(char16_t('/'));
35 #endif