test_bug667315.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=667315
  5. -->
  6. <head>
  7. <title>Test for Bug 667315</title>
  8. <script type="application/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=667315">Mozilla Bug 667315</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. </div>
  16. <pre id="test">
  17. <script type="application/javascript">
  18. /** Test for Bug 667315 **/
  19. var style =
  20. '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ' +
  21. 'version="1.0">' +
  22. '<xsl:variable name="var">' +
  23. '<html><p>a</p></html>' +
  24. '</xsl:variable>' +
  25. '<xsl:template match="/">' +
  26. '<xsl:copy-of select="$var" />' +
  27. '</xsl:template>' +
  28. '</xsl:stylesheet>';
  29. var styleDoc = new DOMParser().parseFromString (style, "text/xml");
  30. var data = '<root/>';
  31. var originalDoc = new DOMParser().parseFromString(data, "text/xml");
  32. var processor = new XSLTProcessor();
  33. processor.importStylesheet(styleDoc);
  34. var doc = processor.transformToDocument(originalDoc);
  35. ok(doc instanceof HTMLDocument, "should have switched to html output method");
  36. </script>
  37. </pre>
  38. </body>
  39. </html>