OLD | NEW |
1 <?xml-stylesheet href="resources/detached-style.css" title="testSheet"?> | 1 <?xml-stylesheet href="resources/detached-style.css" title="testSheet"?> |
2 <html xmlns="http://www.w3.org/1999/xhtml"> | 2 <html xmlns="http://www.w3.org/1999/xhtml"> |
3 <head> | 3 <head> |
4 <title/> | 4 <title/> |
5 <link rel="stylesheet" href="resources/detached-style.css" type="text/css" title
="testSheet"/> | 5 <link rel="stylesheet" href="resources/detached-style.css" type="text/css" title
="testSheet"/> |
6 <style title="testSheet"> | 6 <style title="testSheet"> |
7 * { } | 7 * { } |
8 </style> | 8 </style> |
9 <script src="../../js/resources/js-test-pre.js"></script> | 9 <script src="../../../resources/js-test.js"></script> |
10 </head> | 10 </head> |
11 <body onload="start()"> | 11 <body onload="start()"> |
12 <script> | 12 <script> |
13 window.jsTestIsAsync = true; | 13 window.jsTestIsAsync = true; |
14 | 14 |
15 description("Test that custom properties on stylesheets survive GC"); | 15 description("Test that custom properties on stylesheets survive GC"); |
16 | 16 |
17 function test(expr) | 17 function test(expr) |
18 { | 18 { |
19 shouldBe(expr + ".title", "'testSheet'"); | 19 shouldBe(expr + ".title", "'testSheet'"); |
20 | 20 |
21 eval(expr).foo = "bar"; | 21 eval(expr).foo = "bar"; |
22 | 22 |
23 gc(); | 23 gc(); |
24 | 24 |
25 shouldBe(expr + ".foo", "'bar'"); | 25 shouldBe(expr + ".foo", "'bar'"); |
26 } | 26 } |
27 | 27 |
28 function start() | 28 function start() |
29 { | 29 { |
30 test("document.firstChild.sheet"); | 30 test("document.firstChild.sheet"); |
31 test("document.getElementsByTagName('link')[0].sheet"); | 31 test("document.getElementsByTagName('link')[0].sheet"); |
32 test("document.getElementsByTagName('style')[0].sheet"); | 32 test("document.getElementsByTagName('style')[0].sheet"); |
33 finishJSTest(); | 33 finishJSTest(); |
34 } | 34 } |
35 | 35 |
36 </script> | 36 </script> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |