<!DOCTYPE html>
<title>Specificity for complex :has selectors</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<link rel="help" href="https://drafts.csswg.org/selectors/#specificity-rules">
<style>
  main :has(#foo) { --t0:PASS; }
  main :has(.foo) { --t0:FAIL; }

  main :has(span#foo) { --t1:PASS; }
  main :has(#foo) { --t1:FAIL; }

  main :has(.bar, #foo) { --t2:FAIL; }
  main :has(#foo, .bar) { --t2:PASS; }

  main :has(.bar, #foo