-
Notifications
You must be signed in to change notification settings - Fork 83
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
Procedural :has
applies to multiple selectors; native :has
only applies to the last one
#2480
Comments
Support for |
@uBlock-user it's caused by the semantics uBO applies to procedural selectors vs. native selectors. uBO doesn't seem to be aware of the state of the In other words, without native docs.rs##form:has(invalid)
docs.rs##.recent-releases-container:has(invalid) versus on platforms with native docs.rs##form
docs.rs##.recent-releases-container:has(invalid) |
To be clear, I'm not sure if it's actually worth fixing this case specifically if Firefox is likely to catch up soon. But I'd definitely like to see the distinction between how native vs. non-native pseudoselectors are applied to multiple selectors:
because it's quite subtle and unexpected. |
https://github.com/uBlockOrigin/uBlock-issues/wiki/Procedural-cosmetic-filters#important It was always broken, only slightly patched. |
If it is truly undefined/unintended behavior, I'll just note there are a handful of filters in
(not an exhaustive list) |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as outdated.
This comment was marked as outdated.
Fix maybe need wait due is not easy: |
|
Rather, it is useful - someone can do tests on how its presence affects a non-updated add-on (all line should be ignored). (AdguardTeam/ExtendedCss#164) In part, it is worth watching to see if it begins to require use: public.suffix##:is(a,b):others()
! or
public.suffix##:where(a,b):others() When uBo copies the "CSS4" logic for all except vanilla selectors w/ & w/o |
To check also needed by use Orion: Here vanilla CSS implementation should be unlocked if use same engine like Safari 15.4+. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as abuse.
This comment was marked as abuse.
@gorhill I'm on FF121 since a few hours ago, but it doesn't seem to work correctly with the E.g. In this issue, before submitting this comment:
On Chrome it matched 20 for each of these. Correct elements/highlights. Tested on a new browser profile for both. |
This comment was marked as abuse.
This comment was marked as abuse.
Maybe, but I thought this would fix it: gorhill/uBlock@c5724c1cce |
This is supposed to fix it, but for unknown reasons, runtime.getBrowserInfo is not defined in the element picker context, this causes |
This comment was marked as abuse.
This comment was marked as abuse.
IMO 116+ are needed to safe hide elements, so ESR should be blocked untill released new 128 ESR at 9 june 2024 (and Windows 7, 8 and 8.1 moved to Mint or Ubuntu). |
One could still add a warning in the linter that the filter can move in CSS 4 and will hide the element even if it has no children or siblings (e.g. lists from Nordic project https://github.com/DandelionSprout/adfilt if wasn't converted at all to use |
Prerequisites
I tried to reproduce the issue when...
Description
Cosmetic filters with multiple selectors and
:has
are interpreted differently depending on whether the browser has native:has
support.A specific URL where the issue occurs.
docs.rs
Steps to Reproduce
Add this custom filter:
Expected behavior
The filter should ideally be interpreted the same way on Chromium and Firefox.
Intuitively,
form
(which appears in the page's top navbar) should be hidden. As far as I can tell, the propagation of procedural operators to previously listed selectors is not documented in the wiki.Actual behavior
The filter causes
form
to be hidden on Chromium browsers, but nothing is hidden in Firefox.uBO version
1.46.0
Browser name and version
Firefox 109.0.1, Chromium 109.0.5414.87
Operating System and version
Arch Linux
The text was updated successfully, but these errors were encountered: