dom/tests/mochitest/bugs/test_bug548828.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/bugs/test_bug548828.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=548828
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 548828</title>
    1.11 +  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
    1.12 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=548828">Mozilla Bug 548828</a>
    1.17 +<p id="display"></p>
    1.18 +<div id="content" style="display: none">
    1.19 +  
    1.20 +</div>
    1.21 +<pre id="test">
    1.22 +<script class="testbody" type="text/javascript">
    1.23 +
    1.24 +/** Test for Bug 548828 **/
    1.25 +  var head = document.getElementsByTagName("head")[0];
    1.26 +  is(document.head, head, "document.head and document.getElementsByTagName(\"head\")[0] should match");
    1.27 +  document.head = "";
    1.28 +  is(document.head, head, "document.head reassigned");
    1.29 +  document.head = document.createElement("head");
    1.30 +  is(document.head, head, "new element created with the name \"head\"");
    1.31 +  document.documentElement.appendChild(document.createElement("head"));
    1.32 +  is(document.head, head, "new child named head appended to document");
    1.33 +  var head2 = document.createElement("head");
    1.34 +  document.documentElement.insertBefore(head2, head);
    1.35 +  is(document.head, head2, "new head inserted before existing head");
    1.36 +
    1.37 +</script>
    1.38 +</pre>
    1.39 +</body>
    1.40 +</html>

mercurial