Bug 234531 - [:has() pseudo-class] :has() selector does not render on first pass?
Summary: [:has() pseudo-class] :has() selector does not render on first pass?
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Antti Koivisto
Keywords: InRadar
: 234559 234642 234732 (view as bug list)
Depends on:
Blocks: 227702
  Show dependency treegraph
Reported: 2021-12-20 15:12 PST by Alex Riviere
Modified: 2022-01-21 08:05 PST (History)
5 users (show)

See Also:

A video demonstrating the bug (13.93 MB, video/quicktime)
2021-12-20 15:12 PST, Alex Riviere
no flags Details
Patch (3.67 KB, patch)
2021-12-22 07:35 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Riviere 2021-12-20 15:12:13 PST
Created attachment 447653 [details]
A video demonstrating the bug

Hey Y'all,

Just downloaded technology preview 137 to play with the new :has() selector.

made this demo: https://codepen.io/fimion/pen/XWeamBQ

the div surrounding the list should have a 2px solid red border.

The css selector does show up in dev tools, and I can uncheck and then check the border rule, and it will then show up.

I've included a video. Please let me know if you need any more information.
Comment 1 Antti Koivisto 2021-12-21 07:55:14 PST
*** Bug 234559 has been marked as a duplicate of this bug. ***
Comment 2 Antti Koivisto 2021-12-21 07:56:00 PST
Looks like a style sharing bug.
Comment 3 Antti Koivisto 2021-12-22 07:35:41 PST
Created attachment 447804 [details]
Comment 4 EWS 2021-12-22 10:35:07 PST
Committed r287362 (245504@main): <https://commits.webkit.org/245504@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447804 [details].
Comment 5 Radar WebKit Bug Importer 2021-12-22 10:36:19 PST
Comment 6 Antti Koivisto 2021-12-26 12:02:44 PST
*** Bug 234642 has been marked as a duplicate of this bug. ***
Comment 7 Antti Koivisto 2022-01-03 06:32:50 PST
*** Bug 234732 has been marked as a duplicate of this bug. ***
Comment 8 Brandon McConnell 2022-01-04 07:56:06 PST
Is there a way to subscribe to this bug and be alerted when the fix is pushed to the live version of Safari TP for testing?
Comment 9 Antti Koivisto 2022-01-04 08:43:01 PST
The fix should be in the next STP. You can follow @WebKit in Twitter to get notified.
Comment 10 cchana 2022-01-09 11:49:33 PST
While I await the next STP, wanted to mention that the following selector worked but aspects of it were ignored.

    label:has(+ input[type="text"])

This would select _all_ labels followed by inputs, rather than only the ones that were followed by text inputs.
Comment 11 Alex Riviere 2022-01-21 07:43:48 PST
Just downloaded STP 138, this bug still exists. It has the same rendering error. Dev tools pick up on the styles correctly, but they are not rendered.

Comment 12 Antti Koivisto 2022-01-21 08:05:51 PST
Unfortunately STP138 was based on a rather old revision (r286944) so is missing most if the more recent fixes.