|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=379120 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 379120</title> |
|
8 <script type="text/javascript" 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=379120">Mozilla Bug 379120</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script class="testbody" type="text/javascript"> |
|
19 |
|
20 /** Test for Bug 379120 **/ |
|
21 |
|
22 var originalString = "<test></test>"; |
|
23 |
|
24 // Parse the content into an XMLDocument |
|
25 var parser = new DOMParser(); |
|
26 var originalDoc = parser.parseFromString(originalString, "text/xml"); |
|
27 |
|
28 var stylesheetText = |
|
29 "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " + |
|
30 "version='1.0' xmlns='http://www.w3.org/1999/xhtml'> " + |
|
31 |
|
32 "<xsl:output method='xml' version='1.0' encoding='UTF-8' " + |
|
33 "doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' " + |
|
34 "doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' /> " + |
|
35 |
|
36 "<xsl:template match='/'>" + |
|
37 "<div onload='var i = 1'/>" + |
|
38 "<xsl:apply-templates />" + |
|
39 "</xsl:template>" + |
|
40 "</xsl:stylesheet>"; |
|
41 var stylesheet = parser.parseFromString(stylesheetText, "text/xml"); |
|
42 |
|
43 var processor = new XSLTProcessor(); |
|
44 |
|
45 var targetDocument; |
|
46 processor.importStylesheet (stylesheet); |
|
47 var transformedDocument = processor.transformToDocument (originalDoc); |
|
48 is(transformedDocument.documentElement.getAttribute("onload"), |
|
49 "var i = 1"); |
|
50 ok(transformedDocument.documentElement.onload === null, |
|
51 "Shouldn't have onload handler", |
|
52 "got " + repr(transformedDocument.documentElement.onload) + |
|
53 ", expected null");; |
|
54 </script> |
|
55 </pre> |
|
56 </body> |
|
57 </html> |
|
58 |