chromium/third_party/blink/web_tests/fast/dom/StyleSheet/gc-parent-rule.html

<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body onload="test()">
<script>
window.jsTestIsAsync = true;
description("Test that CSS rules don't lose custom properties on GC when only reachable through child rules.");

function createCSSStyleSheet()
{
    style = document.createElement("style");
    document.head.appendChild(style);
    shouldBeType("style.sheet", "CSSStyleSheet");
    var sheet = style.sheet;
    document.head.removeChild(style);
    shouldBeNull("style.sheet");
    return sheet;
}

function test()
{
    var sheet = createCSSStyleSheet();
    sheet.insertRule("@media all { div { color:black } }", 0);
    rule = sheet.rules[0].cssRules[0];
    rule.parentRule.foo = "bar";
    sheet = null;

    gc();
    setTimeout(function() {
        gc();
        shouldBe('rule.parentRule.foo', '"bar"');
        finishJSTest();
    }, 0);
}
</script>
<foo id="mystyle" style="display:none">.div { color: white; }</foo>
</body>
</html>