Proposal: add a selector that matches an element if a direct child matches the selector in the function.
"all a elements that contain an img" -> a:has-child(img)
Motivation: #2 missing-features request in the state-of-CSS 2019 survey.
Since it only matches direct children, it may be no more expensive than sibling selectors.
A related selector that was considered and removed as too expensive and slow (AIUI) is :has. See also resolution regarding it here.
@tabatkins @lilles
Proposal: add a selector that matches an element if a direct child matches the selector in the function.
"all a elements that contain an img" ->
a:has-child(img)Motivation: #2 missing-features request in the state-of-CSS 2019 survey.
Since it only matches direct children, it may be no more expensive than sibling selectors.
A related selector that was considered and removed as too expensive and slow (AIUI) is :has. See also resolution regarding it here.
@tabatkins @lilles