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

CSS filters with unclosed pseudo classes works in preview mode #389

Closed
6 of 8 tasks
krystian3w opened this issue Jan 21, 2019 · 10 comments
Closed
6 of 8 tasks

CSS filters with unclosed pseudo classes works in preview mode #389

krystian3w opened this issue Jan 21, 2019 · 10 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@krystian3w
Copy link

krystian3w commented Jan 21, 2019

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

Element picker possible can add filters without closed pseudo classes (/considers them to be correct):

! 1 - 4 filter
##body:not(bodzio
##body:not(.bodzio
##body:not(#bodzio
##body:not([bodzio]

!old 5 filter
##body:nth-of-type(1

!old 7, 8 filter
##html:nth-child(1
##body:nth-child(2

!old 6 filter
##html:lang(en
image

A specific URL where the issue occurs

https://github.com/uBlockOrigin/uBlock-issues/issues/389 #389

Steps to Reproduce

  1. open site and activate element picker
  2. try paste to element picker 1 of 8 demo filters
  3. body/html colorized without closed bracket

Expected behavior:

Element picker require closing of CSS3 pseudo classes, that have brackets.

Actual behavior:

Element picker no require closing of CSS3 pseudo classes, that have brackets.

Your environment

Opera
  • uBlock Origin version: 1.17.0
  • Browser Name and version: Opera 57
  • Operating System and version: Windows 7
Firefox
  • uBlock Origin version: 1.18.2
  • Browser Name and version: Opera 64.0.2
  • Operating System and version: Windows 7

Possible affected vesions:

  • 1.0.0 to 1.17.2 (no test on all possible published versions),
  • 1.17.7rc2,
  • latest stable 1.18.0

no affected know version:

  • 1.17.4
@krystian3w krystian3w changed the title CSS filters works in preview mode without closing the bracket CSS filters with unclosed pseudo classes works in preview mode Jan 21, 2019
@gwarser gwarser added the bug Something isn't working label Jan 21, 2019
@kulfoon
Copy link

kulfoon commented Jan 21, 2019

  • I am running the latest version of uBlock Origin
  • uBlock Origin version: 1.17.0

Definately not the latest version:

  • can't reproduce the issue on 1.17.4 neither on Firefox 64.0.2 64bit nor on Opera 57 64bit
  • however I can reproduce on 1.17.0 and 1.17.7rc2; but on 1.17.7rc2 with the cases 1-4 + 6 only, can't reproduce the cases 5,7,8 (the ones with :nth-)

@krystian3w

This comment has been minimized.

@krystian3w
Copy link
Author

Bug comeback in 1.18.0 and I can reproduce with all 8 demo pseudo class filters.

@krystian3w
Copy link
Author

krystian3w commented Feb 5, 2019

Hello, I found another disaster "similar" glitch.

https://www.mgsm.pl/pl/katalog/lg/q9/LG-Q9.html
https://www.gsmchoice.com/en/catalogue/lg/q9/

with use no closed "[attrib]":

##div.columns > small[style*="color: #c0c0c0; font-s
image
image

Filter is also invalid after save, maybe I try install 1.17.4, maybe still unafected:

    1.17.4 waiting for " to mark as 🔴 "E" (error/invalid) but block add filter to my user panel filters.

    image

if [style] down try reproduce with any other [attrib]:

https://github.com/uBlockOrigin/uBlock-issues/issues/389 #389

##.js-minimizable-comment-group > [class*="unminimized-comment

@kulfoon
Copy link

kulfoon commented Feb 5, 2019

OK - as uBO 1.18.4 has already appeared about an hour ago, I've tried to check the both issues:

  • 1_ the issue from the OP 1st comment is still here and what is interesting, as opposed to what I wrote in my previous CSS filters with unclosed pseudo classes works in preview mode #389 (comment), now I can reproduce all the cases (1-8), not sure if this behaviour is because the cases were perhaps modified meantime by the OP, as it says that comment edit history is deleted.
  • 2_ as for the second issue above - I confirm, also I can add that if add ] to the end of the filter:
    ##div.columns > small[style*="color: #c0c0c0; font-s cannot add the filter anymore:
screenshoot

anim 005

@gorhill
Copy link
Member

gorhill commented Feb 5, 2019

as uBO 1.18.4 ... the issue from the OP 1st comment is still here

Because nowhere in here is it said that it was fixed.

All the reported issues are just flavor of the same underlying one, no need to pile on, this will get fixed eventually.

@kulfoon
Copy link

kulfoon commented Feb 5, 2019

Because nowhere in here is it said that it was fixed.

Yes, but it also could get fixed accidentaly, as issues not only can appear accidentaly, but also can dissappear accidentaly.

gorhill added a commit to gorhill/uBlock that referenced this issue Feb 18, 2019
Related issue:
- uBlockOrigin/uBlock-issues#389

Additionally, fix case of using potentially uninitialized variable
in preview mode. Related issue:
- uBlockOrigin/uBlock-issues#425
@uBlock-user uBlock-user added the fixed issue has been addressed label Feb 19, 2019
@krystian3w
Copy link
Author

I suppose found "regression" with experiment :is(...) pseudo-class selector:

Try use in element picker:

##body :-moz-any(h1
##body :-webkit-any(h1

https://developer.mozilla.org/en-US/docs/Web/CSS/:is

Also afected with "Experimental Web Platform features" in Chrome 75:

##body :is(h1

@gorhill
Copy link
Member

gorhill commented Jul 8, 2019

When I try document.querySelector('body :is(h1'); in the dev console, the browser does not throw an exception, meaning it's a valid selector. When the browser considers a selector is valid, so does uBO.

@krystian3w
Copy link
Author

OK, so bug is in chrome / firefox engine (I cannot test any latest Safari (12/13)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants