Bug 1942639 - Propagate --filter argument from desktop_unittest.py to runreftest...
[gecko.git] / dom / xslt / tests / mochitest / test_bug511487.html
blob324ba04679a35a980beaa6efa56f1dc686ba2479
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=511487
5 -->
6 <head>
7 <title>Test for Bug 511487</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=511487">Mozilla Bug 511487</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
18 <script type="application/javascript">
20 /** Test for Bug 511487 **/
22 var didTransform = false;
23 var processor = new XSLTProcessor();
24 var style =
25 '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml">' +
26 '<xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />' +
27 '<xsl:template match="wml">' +
28 '<html xmlns="http://www.w3.org/1999/xhtml">' +
29 '<head>' +
30 '<title>XSLT test</title>' +
31 '</head>' +
32 '<body onload="window.alert(this)">' +
33 '</body>' +
34 '</html>' +
35 '</xsl:template>' +
36 '</xsl:stylesheet>';
37 var styleDoc = new DOMParser().parseFromString (style, "text/xml");
39 var data =
40 '<?xml version="1.0"?>' +
41 '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">' +
42 '<wml><card><p>paragraph</p></card></wml>';
43 var originalDoc = new DOMParser().parseFromString(data, "text/xml");
45 processor.importStylesheet(styleDoc);
46 try {
47 var transformedDocument = processor.transformToDocument(originalDoc);
48 didTransform = true;
49 } catch (e) {
50 ok(false, e);
53 ok(didTransform, "transformToDocument didn't succeed!");
56 </script>
57 </pre>
58 </body>
59 </html>