getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
9 stars 4 forks source link

fix: Incorrect parsing of functional pseudo class css selector #169

Closed billyvg closed 3 months ago

billyvg commented 3 months ago

This fixes a parsing issue of CSS selectors that use a functional pseudo class with multiple arguments.

For example,

.foo:has(button,div) {}

Would get parsed as 2 selectors: .foo:has(button and div) - this results in an invalid stylesheet and looks like the replay is broken.

billyvg commented 3 months ago

@ryan953 good test cases! I've updated to track the net unbalanced across each selector - however this does add another regex