dom/events/test/test_bug379120.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    20 /** Test for Bug 379120 **/
    22     var originalString = "<test></test>";
    24     // Parse the content into an XMLDocument
    25     var parser = new DOMParser();
    26     var originalDoc = parser.parseFromString(originalString, "text/xml");
    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'> " +
    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' /> " +
    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");
    43     var processor = new XSLTProcessor();
    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>

mercurial