1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/test_bug497242.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 +<!-- 1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=497242 1.7 +--> 1.8 +<head> 1.9 + <title>Test for Bug 497242</title> 1.10 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.11 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.12 +</head> 1.13 +<body> 1.14 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=497242">Mozilla Bug 497242</a> 1.15 +<p id="display"></p> 1.16 +<div id="content" style="display: none"> 1.17 + <form name="foo"/> 1.18 + <form name="foo"/> 1.19 + <form name="bar"/> 1.20 + <form name="bar" xmlns=""/> 1.21 +</div> 1.22 +<pre id="test"> 1.23 +<script type="application/javascript"> 1.24 +<![CDATA[ 1.25 + 1.26 +/** Test for Bug 497242 **/ 1.27 +is(document.getElementsByName("foo").length, 2, 1.28 + "Should find both forms with name 'foo'"); 1.29 +is(document.getElementsByName("foo")[0], 1.30 + document.getElementsByTagName("form")[0], 1.31 + "Unexpected first foo"); 1.32 +is(document.getElementsByName("foo")[1], 1.33 + document.getElementsByTagName("form")[1], 1.34 + "Unexpected second foo"); 1.35 +is(document.getElementsByName("bar").length, 1, 1.36 + "Should find only the HTML form with name 'bar'"); 1.37 +is(document.getElementsByName("bar")[0], 1.38 + document.getElementsByTagName("form")[2], 1.39 + "Unexpected bar"); 1.40 +]]> 1.41 +</script> 1.42 +</pre> 1.43 +</body> 1.44 +</html>