| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="../../../resources/gc.js"></script> |
| 5 </head> | 6 </head> |
| 6 <body> | 7 <body> |
| 7 <script> | 8 <script> |
| 8 description('This tests that properties on the classList persists GC.'); | 9 description('This tests that properties on the classList persists GC.'); |
| 9 | 10 |
| 10 function gc() | |
| 11 { | |
| 12 if (window.GCController) | |
| 13 return GCController.collect(); | |
| 14 | |
| 15 for (var i = 0; i < 10000; i++) { | |
| 16 var s = new String; | |
| 17 } | |
| 18 } | |
| 19 | |
| 20 var d = document.createElement('div'); | 11 var d = document.createElement('div'); |
| 21 | 12 |
| 22 // Ensure the classList is created. | 13 // Ensure the classList is created. |
| 23 var classList = d.classList; | 14 var classList = d.classList; |
| 24 | 15 |
| 25 // Set a custom property. | 16 // Set a custom property. |
| 26 d.classList.life = 42; | 17 d.classList.life = 42; |
| 27 shouldEvaluateTo('d.classList.life', 42); | 18 shouldEvaluateTo('d.classList.life', 42); |
| 28 | 19 |
| 29 // Null out reference to the dataset. | 20 // Null out reference to the dataset. |
| 30 classList = null; | 21 classList = null; |
| 31 | 22 |
| 32 gc(); | 23 gc(); |
| 33 | 24 |
| 34 // Test that the classList wrapper persisted the GC and still has the custom pro
perty. | 25 // Test that the classList wrapper persisted the GC and still has the custom pro
perty. |
| 35 shouldEvaluateTo('d.classList.life', 42); | 26 shouldEvaluateTo('d.classList.life', 42); |
| 36 </script> | 27 </script> |
| 37 </body> | 28 </body> |
| 38 </html> | 29 </html> |
| OLD | NEW |