has-style-sharing-002.html (657B)
1 <!DOCTYPE html> 2 <link rel="author" title="David Shin" href="mailto:dshin@mozilla.com"> 3 <link rel="help" href="https://drafts.csswg.org/selectors-4/#relational"> 4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1793012"> 5 <link rel="match" href="has-style-sharing-002-ref.html"> 6 <meta name="assert" content="Ensure that style sharing optimizations do not interfere with :has() selector matching."> 7 <style> 8 div { 9 background: blue; 10 padding: 1em; 11 margin: 1em; 12 } 13 14 :has(> span) { 15 background: green; 16 } 17 18 span { 19 display: inline-block; 20 width: 1em; 21 height: 1em; 22 background-color: pink; 23 } 24 </style> 25 <div></div> 26 <div><span></span></div>