To determine whether an element matches a :has() pseudo class or not, the style engine needs to match the argument of the :has() to the downward subtree of the element.

During the style recalculation process, a selector in a style rule will be matched to the style invalid elements in the DOM to determine whether the style rule need to be applied to the elements to compute styles.
If the selector contains :has pseudo class, the :has() matching operation can generate a performance issue of repetitive argument matching when a style invalid element contains additional style invalid elements in it's downward subtree.
We can prevent the repetitive argument matching operations by caching the :has matching result. You can get the details from the previous document about :has matching prototyping.

