1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/events/test/test_bug379120.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=379120 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 379120</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=379120">Mozilla Bug 379120</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script class="testbody" type="text/javascript"> 1.22 + 1.23 +/** Test for Bug 379120 **/ 1.24 + 1.25 + var originalString = "<test></test>"; 1.26 + 1.27 + // Parse the content into an XMLDocument 1.28 + var parser = new DOMParser(); 1.29 + var originalDoc = parser.parseFromString(originalString, "text/xml"); 1.30 + 1.31 + var stylesheetText = 1.32 + "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " + 1.33 + "version='1.0' xmlns='http://www.w3.org/1999/xhtml'> " + 1.34 + 1.35 + "<xsl:output method='xml' version='1.0' encoding='UTF-8' " + 1.36 + "doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' " + 1.37 + "doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' /> " + 1.38 + 1.39 + "<xsl:template match='/'>" + 1.40 + "<div onload='var i = 1'/>" + 1.41 + "<xsl:apply-templates />" + 1.42 + "</xsl:template>" + 1.43 + "</xsl:stylesheet>"; 1.44 + var stylesheet = parser.parseFromString(stylesheetText, "text/xml"); 1.45 + 1.46 + var processor = new XSLTProcessor(); 1.47 + 1.48 + var targetDocument; 1.49 + processor.importStylesheet (stylesheet); 1.50 + var transformedDocument = processor.transformToDocument (originalDoc); 1.51 + is(transformedDocument.documentElement.getAttribute("onload"), 1.52 + "var i = 1"); 1.53 + ok(transformedDocument.documentElement.onload === null, 1.54 + "Shouldn't have onload handler", 1.55 + "got " + repr(transformedDocument.documentElement.onload) + 1.56 + ", expected null");; 1.57 +</script> 1.58 +</pre> 1.59 +</body> 1.60 +</html> 1.61 +