tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / dom / StyleSheet / gc-rule-children-wrappers.html
1 <html>
2 <head>
3
4 <style>
5 @import url("data:text/css,* { color:black; }");
6
7 * { color: black }
8
9 @font-face {
10     font-family: 'CustomName';
11     src: local('Courier');
12 }
13
14 @media all {
15     * { color: black }
16 }
17
18 @-webkit-keyframes test1 {
19     from { left: 10px; }
20     to { left: 20px; }
21 }
22
23 @page { margin: 3cm; }
24 </style>
25 <script src="../../js/resources/js-test-pre.js"></script>
26 </head>
27 <body style="color:black">
28 <script>
29     description("Test that custom properties on rule style declarations are not lost after GC");
30
31     function test(expr, expectedType, testWhat)
32     {
33         shouldBe(expr + ".type", expectedType);
34         eval(expr + "." + testWhat).foo = "bar"
35         gc();
36         shouldBe(expr + "." + testWhat + ".foo", "'bar'");
37     }
38
39     test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "media");
40     test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "styleSheet");
41     test("document.styleSheets[0].cssRules[1]", "CSSRule.STYLE_RULE", "style");
42     test("document.styleSheets[0].cssRules[2]", "CSSRule.FONT_FACE_RULE", "style");
43     test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "cssRules");
44     test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "media");
45     test("document.styleSheets[0].cssRules[4]", "CSSRule.WEBKIT_KEYFRAMES_RULE", "cssRules");
46     test("document.styleSheets[0].cssRules[4].cssRules[0]", "CSSRule.WEBKIT_KEYFRAME_RULE", "style");
47     test("document.styleSheets[0].cssRules[5]", "CSSRule.PAGE_RULE", "style");
48
49 </script>
50 <script src="../../js/resources/js-test-post.js"></script>
51 </body>
52 </html>