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

Deprecate pseudo operator :if(...), :if-not(...), reuse :has(...), :not(...) #3683

Closed
gorhill opened this issue Apr 6, 2018 · 6 comments
Closed

Comments

@gorhill
Copy link
Owner

gorhill commented Apr 6, 2018

A while ago I modified the behavior of :has(...) to behave like :if(...)in order to more easily translate Adguard's own pseudo-operators. To simplify things I should just deprecate :if(...)/:if-not(...), to be replaced with :has(...)/:not(...) (Adguard uses :not(...)).

The parser will translate deprecated :if(...)/:if-not(...), but eventually in some future support should be removed completely.

@gorhill gorhill changed the title Deprecate pseudo operator :if(...), :if-not(...), reuse :has(...) and add :has-not(...) Deprecate pseudo operator :if(...), :if-not(...), reuse :has(...), :not(...) Apr 6, 2018
gorhill added a commit that referenced this issue Aug 25, 2018
@gwarser
Copy link
Contributor

gwarser commented Sep 24, 2018

A while ago I modified the behavior of :has(...) to behave like :if(...)in order to more easily translate Adguard's own pseudo-operators

37fde84 for 1.15.0

@gwarser
Copy link
Contributor

gwarser commented Sep 25, 2018

gorhill added a commit that referenced this issue Dec 15, 2018
Related issue: <#3683>

Additionally, improve compile-time error reporting in the logger
@gorhill
Copy link
Owner Author

gorhill commented Dec 16, 2018

If the last commit proves to work as expected, that should solve the issue here.

@gwarser
Copy link
Contributor

gwarser commented Dec 16, 2018

Last commit was about uBlockOrigin/uBlock-issues#341 (comment)

Reject instances of :not() filters for which the argument is a valid CSS selector, otherwise we would be adversely changing the behavior of CSS4's :not().

@gwarser
Copy link
Contributor

gwarser commented Dec 16, 2018

Can you pleas check wiki and describe how this should work from your point of view?

https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#subjectnotarg

@gorhill
Copy link
Owner Author

gorhill commented Dec 16, 2018

I reviewed the doc.

Note that I referred to the issue here in the commit because the original commit in the other issue was not really fixing the issue raised, it was however addressing partially the issue here.

gorhill added a commit that referenced this issue Dec 26, 2018
Related issue:
- #3683

This commit further increases uBO's procedural cosmetic filters
Adguard's cosmetic filter syntax -- specifically those procedural
cosmetic filters where plain CSS selectors appeared following
a procedural oeprator (this was rejected as invalid by uBO).

Also, experimental support for `:watch-attrs` procedural
operator, as discussed in <uBlockOrigin/uBlock-issues#341 (comment)>.
Support may be dropped before next release depending on whether
a better solution is suggested.

Additionally, the usual opportunistic refactoring toward ES6
syntax.
@gorhill gorhill closed this as completed Dec 26, 2018
nimasaj added a commit to nimasaj/uBOPa that referenced this issue Jan 27, 2019
Updating syntaxes based on latest uBO changes.
script:inject(...) >> +js(...), : https://github.com/gorhill/uBlock/wiki/Static-filter-syntax
:if(...), :if-not(...) >> :has(...), :not(...), : gorhill/uBlock#3683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants