mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 939970 - Only convert XPath result to type requested. r=sicking.
--HG-- extra : rebase_source : 9cec2445b10b477244de9b7eebba573c39860442
This commit is contained in:
parent
ce61bc6fe4
commit
efb96cc475
@ -258,6 +258,8 @@ nsresult
|
||||
nsXPathResult::SetExprResult(txAExprResult* aExprResult, uint16_t aResultType,
|
||||
nsINode* aContextNode)
|
||||
{
|
||||
MOZ_ASSERT(aExprResult);
|
||||
|
||||
if ((isSnapshot(aResultType) || isIterator(aResultType) ||
|
||||
isNode(aResultType)) &&
|
||||
aExprResult->getResultType() != txAExprResult::NODESET) {
|
||||
@ -279,11 +281,29 @@ nsXPathResult::SetExprResult(txAExprResult* aExprResult, uint16_t aResultType,
|
||||
|
||||
// XXX This will keep the recycler alive, should we clear it?
|
||||
mResult = aExprResult;
|
||||
mBooleanResult = mResult->booleanValue();
|
||||
mNumberResult = mResult->numberValue();
|
||||
mResult->stringValue(mStringResult);
|
||||
switch (mResultType) {
|
||||
case BOOLEAN_TYPE:
|
||||
{
|
||||
mBooleanResult = mResult->booleanValue();
|
||||
break;
|
||||
}
|
||||
case NUMBER_TYPE:
|
||||
{
|
||||
mNumberResult = mResult->numberValue();
|
||||
break;
|
||||
}
|
||||
case STRING_TYPE:
|
||||
{
|
||||
mResult->stringValue(mStringResult);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
MOZ_ASSERT(isNode() || isIterator() || isSnapshot());
|
||||
}
|
||||
}
|
||||
|
||||
if (aExprResult && aExprResult->getResultType() == txAExprResult::NODESET) {
|
||||
if (aExprResult->getResultType() == txAExprResult::NODESET) {
|
||||
txNodeSet *nodeSet = static_cast<txNodeSet*>(aExprResult);
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
int32_t i, count = nodeSet->size();
|
||||
|
Loading…
Reference in New Issue
Block a user