Files
ladybird/Tests/LibWeb/Text/input/css-has-invalidation/has-order-insensitive-plan-merge.html
Andreas Kling 55ebd8a589 LibWeb: Ignore invalidation rule order when merging plans
Treat structurally equivalent invalidation plans as equal even when
their descendant or sibling rules were accumulated in a different
order. This lets :has() invalidation merge more of the repeated
descendant-only payloads that still showed up after the earlier
structural dedup.

Add a :has() invalidation counter test that exercises equivalent
selector permutations so this shape stays covered.
2026-04-20 13:20:41 +02:00

29 lines
951 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script src="_helpers.js"></script>
<style>
.anchor:has(:is(.outer-a, .outer-b) :is(.inner-a, .inner-b) .leaf) { color: red; }
.anchor:has(:is(.outer-b, .outer-a) :is(.inner-b, .inner-a) .leaf) { color: red; }
.anchor:has(:is(.outer-a, .outer-b) :is(.inner-b, .inner-a) .leaf) { color: red; }
.anchor:has(:is(.outer-b, .outer-a) :is(.inner-a, .inner-b) .leaf) { color: red; }
</style>
<div class="anchor" id="anchor">
<div class="outer-a" id="outer">
<div class="inner-b" id="inner">
<span id="target">leaf</span>
</div>
</div>
</div>
<script>
test(() => {
let anchor = document.getElementById("anchor");
let target = document.getElementById("target");
settleAndReset(anchor);
target.classList.add("leaf");
getComputedStyle(anchor).color;
printCounters("after add .leaf");
});
</script>