blob: b3e6cf4da811b1e3ad540e1a9edad2fcaf98050f [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<host id="host">
<div>
<div id="green" class="b">This text should be green</div>
</div>
</host>
<script>
description("No need to invalidate for selectors right of ::content as ::content causes subtree invalidation.");
var root = host.createShadowRoot();
root.innerHTML = '<style>.a ::content .b { color: green }</style><div id="outer"><div class="b"><div class="b"><div class="b"><content/></div></div></div></div>';
shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 0, 0)");
host.offsetTop; // force recalc
root.querySelector("#outer").className = "a";
if (window.internals)
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 128, 0)");
</script>