Page 1 of 1

[Done] Element Hiding Helper should always use CSS

PostPosted: 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.

PostPosted: 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?

PostPosted: Wed Apr 22, 2009 7:14 pm
by Dr. Evil
Ares2: with one of these:
Code: Select all
###exampleads,.exampleads
##*[id="exampleads"],*[class~="exampleads"]

PostPosted: 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"?

PostPosted: 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...

PostPosted: 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. :)

PostPosted: 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.

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

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

PostPosted: 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.

PostPosted: 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

PostPosted: 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).

PostPosted: 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

PostPosted: 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.