chromium/third_party/blink/web_tests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html

<style>
.baz:nth-last-child(odd) { display: block;  }
</style>
<script>
function test() {
    var foo = document.createElement('div');
    document.documentElement.appendChild(foo);

    var bar = document.createElement('div');
    var barShadow = bar.attachShadow({mode: 'open'});
    bar.setAttribute('class', 'bar');
    document.documentElement.appendChild(bar);

    baz = document.createElement('span');
    baz.setAttribute('class', 'baz');
    bar.appendChild(baz);

    var qux = document.createElement('div');
    bar.appendChild(qux);

    var ip = document.createElement('shadow');
    barShadow.appendChild(ip);

    document.documentElement.offsetLeft;
    foo.appendChild(qux);
    testRunner.notifyDone();
}

testRunner.waitUntilDone();
testRunner.dumpAsText();
window.onload = test;
</script>