| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title></title> | 3 <title></title> |
| 4 <script src=/resources/testharness.js></script> | 4 <script src=/resources/testharness.js></script> |
| 5 <script src=/resources/testharnessreport.js></script> | 5 <script src=/resources/testharnessreport.js></script> |
| 6 <!-- We want to use a tag name that will not interact with our test harness, | 6 <!-- We want to use a tag name that will not interact with our test harness, |
| 7 so just make one up. "foo" is a good one --> | 7 so just make one up. "foo" is a good one --> |
| 8 | 8 |
| 9 <!-- Ids that look like negative indices. These should come first, so we can | 9 <!-- Ids that look like negative indices. These should come first, so we can |
| 10 assert that lookups for nonnegative indices find these by index --> | 10 assert that lookups for nonnegative indices find these by index --> |
| 11 <foo id="-2"></foo> | 11 <foo id="-2"></foo> |
| 12 <foo id="-1"></foo> | 12 <foo id="-1"></foo> |
| 13 | 13 |
| 14 <!-- Ids that look like nonnegative indices --> | 14 <!-- Ids that look like nonnegative indices --> |
| 15 <foo id="0"></foo> | 15 <foo id="0"></foo> |
| 16 <foo id="1"></foo> | 16 <foo id="1"></foo> |
| 17 | 17 |
| 18 <!-- Ids that look like nonnegative indices near 2^31 = 2147483648 --> | 18 <!-- Ids that look like nonnegative indices near 2^31 = 2147483648 --> |
| 19 <foo id="2147483645"></foo> <!-- 2^31 - 3 --> | 19 <foo id="2147483645"></foo> <!-- 2^31 - 3 --> |
| 20 <foo id="2147483646"></foo> <!-- 2^31 - 2 --> | 20 <foo id="2147483646"></foo> <!-- 2^31 - 2 --> |
| 21 <foo id="2147483647"></foo> <!-- 2^31 - 1 --> | 21 <foo id="2147483647"></foo> <!-- 2^31 - 1 --> |
| 22 <foo id="2147483648"></foo> <!-- 2^31 --> | 22 <foo id="2147483648"></foo> <!-- 2^31 --> |
| 23 <foo id="2147483649"></foo> <!-- 2^31 + 1 --> | 23 <foo id="2147483649"></foo> <!-- 2^31 + 1 --> |
| 24 | 24 |
| 25 <!-- Ids that look like nonnegative indices near 2^32 = 4294967296 --> | 25 <!-- Ids that look like nonnegative indices near 2^32 = 4294967296 --> |
| 26 <foo id="4294967293"></foo> <!-- 2^32 - 3 --> | 26 <foo id="4294967293"></foo> <!-- 2^32 - 3 --> |
| 27 <foo id="4294967294"></foo> <!-- 2^32 - 2 --> | 27 <foo id="4294967294"></foo> <!-- 2^32 - 2 --> |
| 28 <foo id="4294967295"></foo> <!-- 2^32 - 1 --> | 28 <foo id="4294967295"></foo> <!-- 2^32 - 1 --> |
| 29 <foo id="4294967296"></foo> <!-- 2^32 --> | 29 <foo id="4294967296"></foo> <!-- 2^32 --> |
| 30 <foo id="4294967297"></foo> <!-- 2^32 + 1 --> | 30 <foo id="4294967297"></foo> <!-- 2^32 + 1 --> |
| 31 | 31 |
| 32 <script> | 32 <script> |
| 33 test(function() { | 33 test(function() { |
| 34 var collection = document.getElementsByTagName("foo"); | 34 var collection = document.getElementsByTagName("foo"); |
| 35 assert_equals(collection.item(-2), null); | 35 assert_equals(collection.item(-2), null); |
| 36 assert_equals(collection.item(-1), null); | 36 assert_equals(collection.item(-1), null); |
| 37 assert_equals(collection.namedItem(-2), document.getElementById("-2")); | 37 assert_equals(collection.namedItem(-2), document.getElementById("-2")); |
| 38 assert_equals(collection.namedItem(-1), document.getElementById("-1")); | 38 assert_equals(collection.namedItem(-1), document.getElementById("-1")); |
| 39 assert_equals(collection[-2], document.getElementById("-2")); | 39 assert_equals(collection[-2], document.getElementById("-2")); |
| 40 assert_equals(collection[-1], document.getElementById("-1")); | 40 assert_equals(collection[-1], document.getElementById("-1")); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 document.getElementById("4294967296")); | 91 document.getElementById("4294967296")); |
| 92 assert_equals(collection.namedItem(4294967297), | 92 assert_equals(collection.namedItem(4294967297), |
| 93 document.getElementById("4294967297")); | 93 document.getElementById("4294967297")); |
| 94 assert_equals(collection[4294967293], undefined); | 94 assert_equals(collection[4294967293], undefined); |
| 95 assert_equals(collection[4294967294], undefined); | 95 assert_equals(collection[4294967294], undefined); |
| 96 assert_equals(collection[4294967295], document.getElementById("4294967295")); | 96 assert_equals(collection[4294967295], document.getElementById("4294967295")); |
| 97 assert_equals(collection[4294967296], document.getElementById("4294967296")); | 97 assert_equals(collection[4294967296], document.getElementById("4294967296")); |
| 98 assert_equals(collection[4294967297], document.getElementById("4294967297")); | 98 assert_equals(collection[4294967297], document.getElementById("4294967297")); |
| 99 }, "Handling of property names that look like integers around 2^32"); | 99 }, "Handling of property names that look like integers around 2^32"); |
| 100 </script> | 100 </script> |
| OLD | NEW |