dom/xslt/tests/mochitest/test_bug667315.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xslt/tests/mochitest/test_bug667315.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=667315
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 667315</title>
    1.11 +  <script type="application/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=667315">Mozilla Bug 667315</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 type="application/javascript">
    1.22 +
    1.23 +/** Test for Bug 667315 **/
    1.24 +
    1.25 +var style =
    1.26 +  '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ' +
    1.27 +                  'version="1.0">' +
    1.28 +    '<xsl:variable name="var">' +
    1.29 +      '<html><p>a</p></html>' +
    1.30 +    '</xsl:variable>' +
    1.31 +    '<xsl:template match="/">' +
    1.32 +      '<xsl:copy-of select="$var" />' +
    1.33 +    '</xsl:template>' +
    1.34 +  '</xsl:stylesheet>';
    1.35 +var styleDoc = new DOMParser().parseFromString (style, "text/xml");
    1.36 +
    1.37 +var data = '<root/>';
    1.38 +var originalDoc = new DOMParser().parseFromString(data, "text/xml");
    1.39 +
    1.40 +var processor = new XSLTProcessor();
    1.41 +processor.importStylesheet(styleDoc);
    1.42 +
    1.43 +var doc = processor.transformToDocument(originalDoc);
    1.44 +ok(doc instanceof HTMLDocument, "should have switched to html output method");
    1.45 +
    1.46 +</script>
    1.47 +</pre>
    1.48 +</body>
    1.49 +</html>

mercurial