[Done] Element Hiding Helper should always use CSS

Various discussions related to Adblock Plus development
Locked
Wladimir Palant

[Done] Element Hiding Helper should always use CSS

Post by Wladimir Palant »

From the Mozilla Russia forum came the question why the Element Hiding Helper sometimes uses simplified syntax and sometimes raw CSS. It seems that simplified syntax only causes confusion since it is very different from CSS (for historical reasons). So the idea is to phase out simplified syntax - and the first step would be to make Element Hiding Helper always use raw CSS, regardless of whether the same can be expressed with simplified syntax.
Last edited by Wladimir Palant on Wed Apr 29, 2009 9:48 am, edited 1 time in total.
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Post by Ares2 »

I like the idea. :)

BTW, this might be a little bit off-topic, but how do you translate

Code: Select all

#*(exampleads)
into raw css?
Dr. Evil
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Post by Dr. Evil »

Ares2: with one of these:

Code: Select all

###exampleads,.exampleads
##*[id="exampleads"],*[class~="exampleads"]
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Post by Ares2 »

So there is no real solution to catch all attributes? Or does #*(exampleads) only apply to "id" and "class"?
Dr. Evil
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Post by Dr. Evil »

Yes, afaik your filter only applies to id and class.

And no, in CSS (and this is also what the simple filters are translated to), there's no way to match "any element with any attribute with a value of xx". But I don't think it would make too much sense, either...
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Post by Ares2 »

Dr. Evil wrote:Yes, afaik your filter only applies to id and class.
Seems to be true.
Dr. Evil wrote:And no, in CSS (and this is also what the simple filters are translated to), there's no way to match "any element with any attribute with a value of xx".
OK, thanks for clarifying that. :)
Wladimir Palant

Post by Wladimir Palant »

What Dr.Evil said - that's the CSS selector these rules are being translated into. The second rule he mentions should be equivalent, at least for HTML.
Wladimir Palant

Post by Wladimir Palant »

User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

will this break anything?
Wladimir Palant

Post by Wladimir Palant »

Shouldn't - Adblock Plus continues to support the "simplified" syntax, at least for now. It is only about new rules created by EHH, they will always use "raw CSS" syntax.
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

Yeah a toggle, a switchable option, I'm prefer the simple css strings, easier on the eyes.. and its still valid
Wladimir Palant

Post by Wladimir Palant »

The problem is that "simple" syntax can only cover the most simple cases - EHH would still need to switch to CSS for everything else. And it is not that different, square brackets instead of parentheses and quotation marks around values. Is "easier on the eyes" a matter of getting used to it? Because it needs a good argument to make me revert this change (which is basically what you are asking for).
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

not revert, but allow both? maybe default to raw, and toggle to simple filters if required.. I'm old school, and hate change :P
Wladimir Palant

Post by Wladimir Palant »

I cannot allow both - if 99% of the people (myself included) use raw CSS only nobody will tell me if I change something and incidentally break simplified syntax. As with any options, only the default path gets proper testing which is why the cost of supporting the option gets very high.
Locked