/parser/htmlparser/tests/mochitest/test_bug502091.html

http://github.com/zpao/v8monkey · HTML · 37 lines · 28 code · 4 blank · 5 comment · 0 complexity · d1eac875c093bfe3d16c579cc1090d1c MD5 · raw file

  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=502091
  5. Adding a <meta> element by writing to innerHTML should work correctly.
  6. -->
  7. <head>
  8. <title>Test for Bug 502091</title>
  9. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=502091">Mozilla Bug 502091</a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none">
  16. </div>
  17. <div id="test">
  18. <script class="testbody" type="text/javascript">
  19. function $(id) { return document.getElementById(id); }
  20. var iframe=document.createElement("iframe");
  21. iframe.setAttribute("id", "iframe");
  22. iframe.src = "bug_502091_iframe.html";
  23. iframe.onload = function () {
  24. var div = $("iframe").contentDocument.getElementById("testdiv");
  25. var meta = div.getElementsByTagName("meta");
  26. is(meta.length, 1, "meta element not added to div");
  27. };
  28. $("test").appendChild(iframe);
  29. </script>
  30. </div>
  31. </body>
  32. </html>