Page 1 of 1

[Done] Element Hiding Helper should always use CSS

Posted: Wed Apr 22, 2009 9:57 am
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.

Posted: Wed Apr 22, 2009 7:08 pm
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?

Posted: Wed Apr 22, 2009 7:14 pm
by Dr. Evil
Ares2: with one of these:

Code: Select all

###exampleads,.exampleads
##*[id="exampleads"],*[class~="exampleads"]

Posted: Wed Apr 22, 2009 7:31 pm
by Ares2
So there is no real solution to catch all attributes? Or does #*(exampleads) only apply to "id" and "class"?

Posted: Wed Apr 22, 2009 8:24 pm
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...

Posted: Thu Apr 23, 2009 12:08 am
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. :)

Posted: Thu Apr 23, 2009 8:30 am
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.

Posted: Wed Apr 29, 2009 9:47 am
by Wladimir Palant

Posted: Wed Apr 29, 2009 9:55 am
by fanboy
will this break anything?

Posted: Wed Apr 29, 2009 10:00 am
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.

Posted: Thu Apr 30, 2009 8:42 am
by fanboy
Yeah a toggle, a switchable option, I'm prefer the simple css strings, easier on the eyes.. and its still valid

Posted: Thu Apr 30, 2009 8:51 am
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).

Posted: Thu Apr 30, 2009 9:01 am
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

Posted: Thu Apr 30, 2009 9:38 am
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.