RESOLVED FIXED 293230
Nested selectors seem to match the originating element when the parent selector contains a pseudo element
https://bugs.webkit.org/show_bug.cgi?id=293230
Summary Nested selectors seem to match the originating element when the parent select...
romain
Reported 2025-05-19 05:25:26 PDT
https://codepen.io/romainmenke/pen/ZYYNOgv div::before { & { color: red; } } This CSS makes the containing "div" red. While the selector should instead be invalid. Even when valid (if allowed by the specification, which it isn't) it should match the pseudo element and not the originating element
Attachments
Radar WebKit Bug Importer
Comment 1 2025-05-19 05:25:33 PDT
Ahmad Saleem
Comment 2 2025-05-19 05:41:01 PDT
*** Safari Technology Preview 219 *** Red square <--- Broken *** Chrome Canary 138.0.7187.0 (Official Build) canary (arm64) *** Green square *** Firefox Nightly 140 (20250517140417) *** Green square
romain
Comment 3 2025-05-19 05:42:41 PDT
I've also opened a pull request in WPT: https://github.com/web-platform-tests/wpt/pull/52634 to cover this case.
Matthieu Dubet
Comment 4 2025-06-04 08:16:49 PDT
EWS
Comment 5 2025-06-12 07:44:13 PDT
Committed 296144@main (78f541198890): <https://commits.webkit.org/296144@main> Reviewed commits have been landed. Closing PR #46324 and removing active labels.
Matthieu Dubet
Comment 6 2025-06-13 14:35:41 PDT
*** Bug 293548 has been marked as a duplicate of this bug. ***
EWS
Comment 7 2025-06-27 05:14:39 PDT
Committed 289651.588@safari-7621-branch (346786d43be5): <https://commits.webkit.org/289651.588@safari-7621-branch> Reviewed commits have been landed. Closing PR #3168 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.