[Webkit-unassigned] [Bug 270900] New: [css-cascade] Proximity for implicit scopes seems to be ignored for rules with zero specificity

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 12 23:38:54 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=270900

            Bug ID: 270900
           Summary: [css-cascade] Proximity for implicit scopes seems to
                    be ignored for rules with zero specificity
           Product: WebKit
           Version: Safari 17
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nathan at knowler.dev

Created attachment 470334

  --> https://bugs.webkit.org/attachment.cgi?id=470334&action=review

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240313/7043ca92/attachment.htm>


More information about the webkit-unassigned mailing list