Bug 227702

Summary: Implement :has() pseudo-class
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, bramus, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, kyle.bavender, macpherson, menard, rego, rik, safari-dev, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 234556, 239868, 227703, 228894, 233443, 233489, 233557, 233631, 233635, 233696, 233758, 233806, 233809, 234341, 234531, 234559, 234561, 234842, 235231, 235399, 235404, 236431, 240581, 241098    
Bug Blocks:    
Attachments:
Description Flags
wip
ews-feeder: commit-queue-
wip none

Description Antti Koivisto 2021-07-06 04:47:20 PDT
https://drafts.csswg.org/selectors/#has-pseudo
Comment 1 Antti Koivisto 2021-07-07 04:40:01 PDT
Created attachment 433022 [details]
wip
Comment 2 Antti Koivisto 2021-07-07 08:21:32 PDT
Created attachment 433031 [details]
wip
Comment 3 Radar WebKit Bug Importer 2021-07-13 04:48:15 PDT
<rdar://problem/80511971>
Comment 4 Antti Koivisto 2021-12-03 09:43:34 PST
This was enabled in http://trac.webkit.org/changeset/286495/webkit
Comment 5 Kyle Bavender 2021-12-20 16:45:36 PST
I am excited to see that :has() is shipping in STP v137! Thanks to all who have contributed to this. I did find something that seems like a potential bug in my testing, however.

The general idea is that...

#form:has(input:checked) .row { background: rebeccapurple; }

...is not toggling that background color if the user checks and unchecks an input, but it really seems that it should.

I created a test case with more details here: https://codepen.io/kbav/pen/YzrxwBa?editors=1100
Comment 6 Antti Koivisto 2021-12-20 22:26:10 PST
Can you file a new bug for this? (it is a style invalidation issue with :checked)