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

Add support for watch-attr, spath, min-text-length and fix parsing AdGuard's rules #240

Merged
merged 9 commits into from Jul 11, 2020

Conversation

hawkeye116477
Copy link
Contributor

@hawkeye116477 hawkeye116477 commented Jul 4, 2020

2020-07-04_13-47

I skipped changes for html filtering.

Now should be more green, so fixing use of sibling-related CSS syntax at prefix position and adding remove and proper upward only left. As you can see looks like that all should be good, but maybe will be good to test that again with more „real" examples.

hawkeye116477 and others added 9 commits Jun 29, 2020
Related issue:
gorhill/uBlock #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 operator (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.

Co-authored-by:  gorhill <585534+gorhill@users.noreply.github.com>
…ilters

Reported by https://github.com/uBlock-user in
https://github.com/orgs/uBlockOrigin/teams/ublock-issues-volunteers/discussions/56

For some reasons, many cosmetic filters in Adguard's Annoyance List
are plain cosmetic filters disguised as style-based cosmetic filters,
and this was breaking uBO's ability to reverse lookup such filters
from the logger.
Related issue:
- uBlockOrigin/uBlock-issues#356

Co-authored-by:  gorhill <585534+gorhill@users.noreply.github.com>
The purpose of this new `:nth-ancestor(n)` operator is to
lookup the nth ancestor relative to the currently selected
node.

It is essentially equivalent to `:xpath(..)`, where
ancestor distance is expressed as a number rather than a
sequence of slash-separated `..`.

The rationale to introduce this new procedural selector
is to have a low overhead way to accomplish ancestor
selection.
Where `x` is the minimal text length of the subject
DOM element. DOM elements whose text length is
greater than or equal to `x` will be selected.
The purpose is to avoid having to iterate through
all input nodes at each operator implementation
level. The `transpose` method deals with only one
input node, and the iteration is performed by the
main procedural filtering entry points.

Additionally:
- Rename `:watch-attrs` to `:watch-attr`
  - `:watch=attrs` is deprecated and will be kept around
    until it is safe to remove it completely
@JustOff
Copy link
Collaborator

@JustOff JustOff commented Jul 4, 2020

Thanks again for your input, which is really important to keep the project alive.

I'm going to put it to testing, just as before.

@JustOff JustOff merged commit b24637a into gorhill:master Jul 11, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants