From b6054b4a2d7a275641946806285445af52d5320f Mon Sep 17 00:00:00 2001 From: "sicking%bigfoot.com" Date: Wed, 2 Nov 2005 07:37:32 +0000 Subject: [PATCH] Make relational comparisons between NodeSets and booleans follow the spec. b=116540 r=Pike sr=jst --- content/xslt/src/xpath/txRelationalExpr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/xslt/src/xpath/txRelationalExpr.cpp b/content/xslt/src/xpath/txRelationalExpr.cpp index b1f6ba1d5cb..405264f04d9 100644 --- a/content/xslt/src/xpath/txRelationalExpr.cpp +++ b/content/xslt/src/xpath/txRelationalExpr.cpp @@ -58,6 +58,9 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) { //-- handle case for just Left NodeSet or Both NodeSets if (ltype == ExprResult::NODESET) { + if (rtype == ExprResult::BOOLEAN) + return compareResults(&BooleanResult(left->booleanValue()), right); + NodeSet* nodeSet = (NodeSet*)left; for ( int i = 0; i < nodeSet->size(); i++) { String str; @@ -70,6 +73,9 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) { } //-- handle case for Just Right NodeSet else if ( rtype == ExprResult::NODESET) { + if (ltype == ExprResult::BOOLEAN) + return compareResults(left, &BooleanResult(right->booleanValue())); + NodeSet* nodeSet = (NodeSet*)right; for ( int i = 0; i < nodeSet->size(); i++) { String str;