dom/tests/mochitest/webcomponents/test_bug900724.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=900724
     5 -->
     6 <head>
     7   <title>Test for form-association in template contents.</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=900724">Bug 900724</a>
    13 <form id="formone"><template id="templateone"><input></template></form>
    14 <form id="formthree"><template id="templatethree"></template></form>
    15 <form id="formfive"><template id="templatefive"></template></form>
    16 <script>
    17 is($("formone").elements.length, 0, "Forms should have no association with controls in template contents.");
    19 var templateOneInput = $("templateone").content.firstChild;
    20 is(templateOneInput.form, null, "Form controls inside template contents should not associate with forms.");
    22 // Try dynamically adding form/form controls using innerHTML.
    23 $("templatethree").innerHTML = '<input>';
    24 is($("formthree").elements.length, 0, "Form controls inside template contents should not associate with forms.");
    26 // Append a form control as a child of the template (not template contents) and make sure form is associated.
    27 var formFiveInput = document.createElement("input");
    28 $("templatefive").appendChild(formFiveInput);
    29 is($("formfive").elements.length, 1, "Form control should associate with form control not in template contents.");
    30 </script>
    31 </body>
    32 </html>

mercurial