Patch by Anders Carlsson <andersca@mac.com>
[WebKit-https.git] / LayoutTests / fast / dom / htmlobject-form.html
1 <html>
2
3     <head>
4         <script language="javascript">
5         function print(message)
6         {
7             var paragraph = document.createElement("p");
8             paragraph.appendChild(document.createTextNode(message));
9             document.getElementById("console").appendChild(paragraph);
10         }
11         function test() 
12         {
13             objectInsideForm = document.getElementById("objectInsideForm");
14             objectNotInsideForm = document.getElementById("objectNotInsideForm");
15         
16             form = document.getElementById("form");
17             
18             if(objectInsideForm.form == form)
19                 print("Passed Test 1");
20             else
21                 print("Failed Test 1");
22                 
23             if(objectNotInsideForm.form == null)
24                 print("Passed Test 2");
25             else
26                 print("Failed Test 2");
27         }
28         </script>
29     </head>
30
31     <body onload="test();">
32         <p>This test attempts to access an HTMLObjectElements form property.</p>
33         
34         <div id="console">
35         </div>  
36               
37         <form id="form">
38             <object id="objectInsideForm">
39             </object>
40         </form>
41         
42         <object id="objectNotInsideForm">
43         </object>
44     </body>   
45 </html>