[Done] Element Hiding Helper should always use CSS

Various discussions related to Adblock Plus development

[Done] Element Hiding Helper should always use CSS

Postby Wladimir Palant » Wed Apr 22, 2009 9:57 am

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.
Wladimir Palant
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Postby Ares2 » Wed Apr 22, 2009 7:08 pm

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?
Ares2
 
Posts: 1275
Joined: Fri Feb 15, 2008 1:47 pm

Postby Dr. Evil » Wed Apr 22, 2009 7:14 pm

Ares2: with one of these:
Code: Select all
###exampleads,.exampleads
##*[id="exampleads"],*[class~="exampleads"]
Dr. Evil
 
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Postby Ares2 » Wed Apr 22, 2009 7:31 pm

So there is no real solution to catch all attributes? Or does #*(exampleads) only apply to "id" and "class"?
Ares2
 
Posts: 1275
Joined: Fri Feb 15, 2008 1:47 pm

Postby Dr. Evil » Wed Apr 22, 2009 8:24 pm

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...
Dr. Evil
 
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Postby Ares2 » Thu Apr 23, 2009 12:08 am

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. :)
Ares2
 
Posts: 1275
Joined: Fri Feb 15, 2008 1:47 pm

Postby Wladimir Palant » Thu Apr 23, 2009 8:30 am

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
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Postby Wladimir Palant » Wed Apr 29, 2009 9:47 am

Wladimir Palant
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Postby fanboy » Wed Apr 29, 2009 9:55 am

will this break anything?
User avatar
fanboy
 
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am

Postby Wladimir Palant » Wed Apr 29, 2009 10:00 am

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.
Wladimir Palant
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Postby fanboy » Thu Apr 30, 2009 8:42 am

Yeah a toggle, a switchable option, I'm prefer the simple css strings, easier on the eyes.. and its still valid
User avatar
fanboy
 
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am

Postby Wladimir Palant » Thu Apr 30, 2009 8:51 am

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).
Wladimir Palant
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Postby fanboy » Thu Apr 30, 2009 9:01 am

not revert, but allow both? maybe default to raw, and toggle to simple filters if required.. I'm old school, and hate change :P
User avatar
fanboy
 
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am

Postby Wladimir Palant » Thu Apr 30, 2009 9:38 am

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.
Wladimir Palant
ABP Developer
 
Posts: 8398
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany


Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 1 guest