<html>
<head>

<style>
@import url("data:text/css,* { color:black; }");

* { color: black }

@font-face {
    font-family: 'CustomName';
    src: local('Courier');
}

@media all {
    * { color: black }
}

@-webkit-keyframes test1 {
    from { left: 10px; }
    to { left: 20px; }
}

@page { margin: 3cm; }
</style>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body style="color:black">
<script>
    description("Test that custom properties on rule style declarations are not lost after GC");

    function test(expr, expectedType, testWhat)
    {
        shouldBe(expr + ".type", expectedType);
        eval(expr + "." + testWhat).foo = "bar"
        gc();
        shouldBe(expr + "." + testWhat + ".foo", "'bar'");
    }

    test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "media");
    test("document.styleSheets[0].cssRules[0]", "CSSRule.IMPORT_RULE", "styleSheet");
    test("document.styleSheets[0].cssRules[1]", "CSSRule.STYLE_RULE", "style");
    test("document.styleSheets[0].cssRules[2]", "CSSRule.FONT_FACE_RULE", "style");
    test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "cssRules");
    test("document.styleSheets[0].cssRules[3]", "CSSRule.MEDIA_RULE", "media");
    test("document.styleSheets[0].cssRules[4]", "CSSRule.WEBKIT_KEYFRAMES_RULE", "cssRules");
    test("document.styleSheets[0].cssRules[4].cssRules[0]", "CSSRule.WEBKIT_KEYFRAME_RULE", "style");
    test("document.styleSheets[0].cssRules[5]", "CSSRule.PAGE_RULE", "style");

</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
