OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 | 3 |
4 <style> | 4 <style> |
5 @import url("data:text/css,* { color:black; }"); | 5 @import url("data:text/css,* { color:black; }"); |
6 | 6 |
7 * { color: black } | 7 * { color: black } |
8 | 8 |
9 @font-face { | 9 @font-face { |
10 font-family: 'CustomName'; | 10 font-family: 'CustomName'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 </style> | 24 </style> |
25 <script src="../../../resources/js-test.js"></script> | 25 <script src="../../../resources/js-test.js"></script> |
26 </head> | 26 </head> |
27 <body style="color:black"> | 27 <body style="color:black"> |
28 <script> | 28 <script> |
29 description("Test that custom properties on rule style declarations are not
lost after GC"); | 29 description("Test that custom properties on rule style declarations are not
lost after GC"); |
30 | 30 |
31 function test(expr, expectedType, testWhat) | 31 function test(expr, expectedType, testWhat) |
32 { | 32 { |
33 shouldBe(expr + ".type", expectedType); | 33 shouldBe(expr + ".type", expectedType); |
34 eval(expr + "." + testWhat).foo = "bar" | 34 // Do initialization work in an inner function to avoid references to |
| 35 // objects remaining live on this function's stack frame |
| 36 // (http://crbug.com/595672/). |
| 37 (() => {eval(expr + "." + testWhat).foo = "bar";})(); |
35 gc(); | 38 gc(); |
36 shouldBe(expr + "." + testWhat + ".foo", "'bar'"); | 39 shouldBe(expr + "." + testWhat + ".foo", "'bar'"); |
37 } | 40 } |
38 | 41 |
39 test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "media"); | 42 test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "media"); |
40 test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "styleShe
et"); | 43 test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "styleShe
et"); |
41 test("document.styleSheets[0].cssRules[1]", "CSSRule.STYLE_RULE", "style"); | 44 test("document.styleSheets[0].cssRules[1]", "CSSRule.STYLE_RULE", "style"); |
42 test("document.styleSheets[0].cssRules[2]", "CSSRule.FONT_FACE_RULE", "style
"); | 45 test("document.styleSheets[0].cssRules[2]", "CSSRule.FONT_FACE_RULE", "style
"); |
43 test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "cssRules"
); | 46 test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "cssRules"
); |
44 test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "media"); | 47 test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "media"); |
45 test("document.styleSheets[0].cssRules[4]", "CSSRule.WEBKIT_KEYFRAMES_RULE",
"cssRules"); | 48 test("document.styleSheets[0].cssRules[4]", "CSSRule.WEBKIT_KEYFRAMES_RULE",
"cssRules"); |
46 test("document.styleSheets[0].cssRules[4].cssRules[0]", "CSSRule.WEBKIT_KEYF
RAME_RULE", "style"); | 49 test("document.styleSheets[0].cssRules[4].cssRules[0]", "CSSRule.WEBKIT_KEYF
RAME_RULE", "style"); |
47 test("document.styleSheets[0].cssRules[5]", "CSSRule.PAGE_RULE", "style"); | 50 test("document.styleSheets[0].cssRules[5]", "CSSRule.PAGE_RULE", "style"); |
48 | 51 |
49 </script> | 52 </script> |
50 </body> | 53 </body> |
51 </html> | 54 </html> |
OLD | NEW |