RESOLVED FIXED 270900
[css-cascade] Proximity for implicit scopes seems to be ignored for rules with zero specificity
https://bugs.webkit.org/show_bug.cgi?id=270900
Summary [css-cascade] Proximity for implicit scopes seems to be ignored for rules wit...
Nathan Knowler
Reported 2024-03-12 23:38:54 PDT
Created attachment 470334 [details] Reduced test case for implicit scope’s proximity being override by explicit scope when selectors have zero specificity. When an implicit `@scope` (i.e. a scope within an embedded style without an explicit scope root) is used and it contains a rule that has a sum of zero specificity (0,0,0) like the universal selector (i.e. `*`) or a selector wrapped with the `:where()` pseudo-class function, it seems like less proximate scopes with the same specificity can override the local scope. The only workaround is to bump the specificity of the selector used in the local scope. From what I’ve observed: - Other properties for the same selector with zero specificity inside the implicit scope where there is no conflict apply fine. - Order of appearance does not seem to cause any difference (e.g. ordering the less proximate explicit scope rule before or after the implicit one), so I assume this is a problem with how scope proximity is being determined for this situation.
Attachments
Reduced test case for implicit scope’s proximity being override by explicit scope when selectors have zero specificity. (2.71 KB, text/html)
2024-03-12 23:38 PDT, Nathan Knowler
no flags
Radar WebKit Bug Importer
Comment 1 2024-03-14 14:50:54 PDT
Matthieu Dubet
Comment 2 2024-03-14 16:58:55 PDT
EWS
Comment 3 2024-03-19 07:43:17 PDT
Committed 276345@main (7b99ea4ee244): <https://commits.webkit.org/276345@main> Reviewed commits have been landed. Closing PR #25918 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.