From 5876257da2bb2bdb43e31854a080422e1b7b2c0a Mon Sep 17 00:00:00 2001 From: Andreas Wictor Date: Tue, 4 May 2010 12:10:44 +0200 Subject: [PATCH] Fix for bug 551654 (The EXSLT node-set function fails to convert number, boolean and string values to text nodes). r=peterv. --- content/xslt/src/xslt/txEXSLTFunctions.cpp | 3 ++ content/xslt/tests/mochitest/Makefile.in | 1 + .../xslt/tests/mochitest/test_bug551654.html | 50 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 content/xslt/tests/mochitest/test_bug551654.html diff --git a/content/xslt/src/xslt/txEXSLTFunctions.cpp b/content/xslt/src/xslt/txEXSLTFunctions.cpp index e9a154d1722..149eb8e6745 100644 --- a/content/xslt/src/xslt/txEXSLTFunctions.cpp +++ b/content/xslt/src/xslt/txEXSLTFunctions.cpp @@ -130,6 +130,9 @@ createTextNode(txIEvalContext *aContext, nsString& aValue, nsresult rv = NS_NewTextNode(getter_AddRefs(text), doc->NodeInfoManager()); NS_ENSURE_SUCCESS(rv, rv); + rv = text->SetText(aValue, PR_FALSE); + NS_ENSURE_SUCCESS(rv, rv); + *aResult = txXPathNativeNode::createXPathNode(text, PR_TRUE); NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); diff --git a/content/xslt/tests/mochitest/Makefile.in b/content/xslt/tests/mochitest/Makefile.in index 03307391008..26cc770bd6a 100644 --- a/content/xslt/tests/mochitest/Makefile.in +++ b/content/xslt/tests/mochitest/Makefile.in @@ -51,6 +51,7 @@ _TEST_FILES = test_bug319374.xhtml \ test_bug453441.html \ test_bug511487.html \ test_bug551412.html \ + test_bug551654.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/xslt/tests/mochitest/test_bug551654.html b/content/xslt/tests/mochitest/test_bug551654.html new file mode 100644 index 00000000000..2bda1add83e --- /dev/null +++ b/content/xslt/tests/mochitest/test_bug551654.html @@ -0,0 +1,50 @@ + + + + + Test for Bug 551654 + + + + + +Mozilla Bug 551654 +

+ +
+
+
+ +