| OLD | NEW |
| 1 <!DOCTYPE html> | 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 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script src="script-tests/class-list-gc.js"></script> | 7 <script> |
| 8 description('This tests that properties on the classList persists GC.'); |
| 9 |
| 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'); |
| 21 |
| 22 // Ensure the classList is created. |
| 23 var classList = d.classList; |
| 24 |
| 25 // Set a custom property. |
| 26 d.classList.life = 42; |
| 27 shouldEvaluateTo('d.classList.life', 42); |
| 28 |
| 29 // Null out reference to the dataset. |
| 30 classList = null; |
| 31 |
| 32 gc(); |
| 33 |
| 34 // Test that the classList wrapper persisted the GC and still has the custom pro
perty. |
| 35 shouldEvaluateTo('d.classList.life', 42); |
| 36 </script> |
| 8 </body> | 37 </body> |
| 9 </html> | 38 </html> |
| OLD | NEW |