[Webkit-unassigned] [Bug 290584] New: Invalid nested selectors cause subsequent property-value pair to be ignored

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 27 16:36:55 PDT 2025


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

            Bug ID: 290584
           Summary: Invalid nested selectors cause subsequent
                    property-value pair to be ignored
           Product: WebKit
           Version: Safari 18
          Hardware: Mac (Apple Silicon)
                OS: macOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: lx2798 at gmail.com

Suppose you have the following nested selector:

```
div {
  font-weight: bold;

  &::-foo-bar {
    font-size: 50px;
  }

  color: blue;
  text-transform: uppercase;
}
```

The nested `&::-foo-bar` rule is invalid and ignored (which is expected), but so is `color: blue`. The `text-transform: uppercase` seems to be processed just fine though. It's as if there's some logic invalidating everything up to the next `;` after an invalid selector.

This bug also invalidates any immediately subsequent nested rule as well, which is particularly annoying because one use case for nested rules is to handle Mozilla-specific `-moz-` selectors:

```
input[type="range"] {
    &::-moz-range-thumb { /* some styling */ }
    &::-webkit-slider-thumb { /* some styling */ }
}
``` 

In this case, the invalid (from WebKit's perspective) `-moz-range-thumb` also invalidates the `-webkit-slider-thumb` (and any nested rule or property-value after that until a `;` is encountered).

Repro at https://codepen.io/andrewfong/pen/RNwYqLr

This bug does not seem to happen with Mozilla and Chrome.

-- 
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/20250327/6b7aee00/attachment.htm>


More information about the webkit-unassigned mailing list