Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider :has(), :not(), :is() as a standard pseudo-class if ExtendedCss usage is not forced by #?# rule marker #1683

Closed
slavaleleka opened this issue Nov 1, 2022 · 2 comments

Comments

@slavaleleka
Copy link

slavaleleka commented Nov 1, 2022

:has() pseudo-class has native implementation
https://developer.mozilla.org/en-US/docs/Web/CSS/:has

and since ExtendedCss v2 release the rule with ## marker and :has() should not be considered as ExtendedCss

const rule1 = 'example.org##.sponsored:has(.banner)';
expect(rule1.isExtendedCss()).toBeFalsy();

but :has() pseudo-class should be considered as ExtendedCss if the rule marker is #?#

const rule2 = 'example.org#?#.sponsored:has(.banner)';
expect(rule2.isExtendedCss()).toBeTruthy();

https://github.com/AdguardTeam/ExtendedCss#extended-css-has


related: AdguardTeam/SafariConverterLib#43

@ameshkov
Copy link
Member

ameshkov commented Nov 1, 2022

This one is a bit more complicated in the case of CoreLibs since this behavior depends on the browser version.

@slavaleleka
Copy link
Author

pseudo-classes :not() and :is() should be handled in the same way as :has()
https://caniuse.com/mdn-css_selectors_not
https://caniuse.com/css-matches-pseudo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants