|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 <!-- |
|
3 https://bugzilla.mozilla.org/show_bug.cgi?id=497242 |
|
4 --> |
|
5 <head> |
|
6 <title>Test for Bug 497242</title> |
|
7 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
9 </head> |
|
10 <body> |
|
11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=497242">Mozilla Bug 497242</a> |
|
12 <p id="display"></p> |
|
13 <div id="content" style="display: none"> |
|
14 <form name="foo"/> |
|
15 <form name="foo"/> |
|
16 <form name="bar"/> |
|
17 <form name="bar" xmlns=""/> |
|
18 </div> |
|
19 <pre id="test"> |
|
20 <script type="application/javascript"> |
|
21 <![CDATA[ |
|
22 |
|
23 /** Test for Bug 497242 **/ |
|
24 is(document.getElementsByName("foo").length, 2, |
|
25 "Should find both forms with name 'foo'"); |
|
26 is(document.getElementsByName("foo")[0], |
|
27 document.getElementsByTagName("form")[0], |
|
28 "Unexpected first foo"); |
|
29 is(document.getElementsByName("foo")[1], |
|
30 document.getElementsByTagName("form")[1], |
|
31 "Unexpected second foo"); |
|
32 is(document.getElementsByName("bar").length, 1, |
|
33 "Should find only the HTML form with name 'bar'"); |
|
34 is(document.getElementsByName("bar")[0], |
|
35 document.getElementsByTagName("form")[2], |
|
36 "Unexpected bar"); |
|
37 ]]> |
|
38 </script> |
|
39 </pre> |
|
40 </body> |
|
41 </html> |