OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>document.all UseCounters</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 test(function() { |
| 7 const DocumentAllItemNoArguments = 1252; // From UseCounter.h |
| 8 assert_false(internals.isUseCounted(document, DocumentAllItemNoArguments)); |
| 9 document.all.item(); |
| 10 assert_true(internals.isUseCounted(document, DocumentAllItemNoArguments)); |
| 11 }, 'document.all.item with no arguments'); |
| 12 |
| 13 test(function() { |
| 14 const DocumentAllItemNamed = 1253; // From UseCounter.h |
| 15 assert_false(internals.isUseCounted(document, DocumentAllItemNamed)); |
| 16 document.all.item('x'); |
| 17 assert_true(internals.isUseCounted(document, DocumentAllItemNamed)); |
| 18 }, 'document.all.item with name'); |
| 19 |
| 20 test(function() { |
| 21 const DocumentAllItemIndexed = 1254; // From UseCounter.h |
| 22 document.all.item(-1); |
| 23 document.all.item(4294967295); |
| 24 assert_false(internals.isUseCounted(document, DocumentAllItemIndexed)); |
| 25 document.all.item(4294967294); |
| 26 assert_true(internals.isUseCounted(document, DocumentAllItemIndexed)); |
| 27 }, 'document.all.item with index'); |
| 28 |
| 29 test(function() { |
| 30 const DocumentAllItemIndexedWithNonNumber = 1255; // From UseCounter.h |
| 31 document.all.item(0); |
| 32 document.all.item(0.5); |
| 33 document.all.item(NaN); |
| 34 document.all.item(Infinity); |
| 35 document.all.item('-1'); |
| 36 document.all.item('00'); |
| 37 document.all.item('4294967295'); |
| 38 assert_false(internals.isUseCounted(document, DocumentAllItemIndexedWithNonNum
ber)); |
| 39 document.all.item('4294967294'); |
| 40 assert_true(internals.isUseCounted(document, DocumentAllItemIndexedWithNonNumb
er)); |
| 41 }, 'document.all.item with index as string'); |
| 42 |
| 43 test(function() { |
| 44 const DocumentAllLegacyCallNoArguments = 1256; // From UseCounter.h |
| 45 assert_false(internals.isUseCounted(document, DocumentAllLegacyCallNoArguments
)); |
| 46 document.all(); |
| 47 assert_true(internals.isUseCounted(document, DocumentAllLegacyCallNoArguments)
); |
| 48 }, 'document.all legacy call with no arguments'); |
| 49 |
| 50 test(function() { |
| 51 const DocumentAllLegacyCallNamed = 1257; // From UseCounter.h |
| 52 assert_false(internals.isUseCounted(document, DocumentAllLegacyCallNamed)); |
| 53 document.all('x'); |
| 54 assert_true(internals.isUseCounted(document, DocumentAllLegacyCallNamed)); |
| 55 }, 'document.all legacy call with name'); |
| 56 |
| 57 test(function() { |
| 58 const DocumentAllLegacyCallIndexed = 1258; // From UseCounter.h |
| 59 document.all(-1); |
| 60 document.all(4294967295); |
| 61 assert_false(internals.isUseCounted(document, DocumentAllLegacyCallIndexed)); |
| 62 document.all(4294967294); |
| 63 assert_true(internals.isUseCounted(document, DocumentAllLegacyCallIndexed)); |
| 64 }, 'document.all legacy call with index'); |
| 65 |
| 66 test(function() { |
| 67 const DocumentAllLegacyCallIndexedWithNonNumber = 1259; // From UseCounter.h |
| 68 document.all(0); |
| 69 document.all(0.5); |
| 70 document.all(NaN); |
| 71 document.all(Infinity); |
| 72 document.all('-1'); |
| 73 document.all('00'); |
| 74 document.all('4294967295'); |
| 75 assert_false(internals.isUseCounted(document, DocumentAllLegacyCallIndexedWith
NonNumber)); |
| 76 document.all('4294967294'); |
| 77 assert_true(internals.isUseCounted(document, DocumentAllLegacyCallIndexedWithN
onNumber)); |
| 78 }, 'document.all legacy call with index as a non-number (string)'); |
| 79 |
| 80 test(function() { |
| 81 const DocumentAllLegacyCallTwoArguments = 1260; // From UseCounter.h |
| 82 document.all('x'); |
| 83 assert_false(internals.isUseCounted(document, DocumentAllLegacyCallTwoArgument
s)); |
| 84 document.all('x', 0); |
| 85 assert_true(internals.isUseCounted(document, DocumentAllLegacyCallTwoArguments
)); |
| 86 }, 'document.all legacy call with two arguments'); |
| 87 </script> |
OLD | NEW |