4 https://bugzilla.mozilla.org/show_bug.cgi?id=1734679
7 <title>Test sorting with invalid lang
</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1734679">Mozilla Bug
1734679</a>
14 <div id=
"content" style=
"display: none">
18 <script class=
"testbody" type=
"text/javascript">
21 * Test for Bug
1734679. Invalid language tags should not throw an error, and should
22 * fall back to the app's locale.
27 xmldoc = new DOMParser().parseFromString('
<?xml version=
"1.0" encoding=
"UTF-8"?>\n\
28 <?xml-stylesheet type=
"text/xsl" href=
"sort-lang.xsl" ?>\n\
31 <technology>CSS
</technology>\n\
32 <term>text-direction
</term>\n\
35 <technology>JavaScript
</technology>\n\
36 <term>Array.prototype.sort
</term>\n\
41 xsltdoc = new DOMParser().parseFromString('
<?xml version=
"1.0" encoding=
"UTF-8"?>\n\
42 <xsl:stylesheet version=
"1.0"\n\
43 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">\n\
44 <xsl:template match=
"/">\n\
48 <tr bgcolor=
"#9acd32">\n\
49 <th>Technology
</th>\n\
52 <xsl:for-each select=
"list/entry">\n\
53 <xsl:sort select=
"term" lang=
"$invalidLanguageTag"/>\n\
55 <td><xsl:value-of select=
"technology"/></td>\n\
56 <td><xsl:value-of select=
"term"/></td>\n\
67 var processor = new XSLTProcessor;
68 processor.importStylesheet(xsltdoc);
72 var result = processor.transformToDocument(xmldoc);
76 ok(false,
"There was an error.");
78 ok(result && result instanceof Document,
"XSLT transform should have created a document");