Closed Bug 75374 Opened 20 years ago Closed 9 years ago

add support for pseudo-classes accepting argument(s)


(Core :: CSS Parsing and Computation, enhancement, P4)






(Reporter: glazou, Assigned: glazou)


(Blocks 1 open bug)


(Keywords: css2, css3, Whiteboard: [Hixie-PF])


(1 file)

In CSS 3, several pseudo-classes accept one or more arguments :

 :lang()               argument is a language keyword or string
 :nth-child()          argument is a keyword or an+b where a and b signed integers
 :nth-last-child()     idem
 :nth-of-type()        idem
 :nth-last-of-type()   idem
 :contains()           argument is a keyword or a string
 :not()                argument is a simple selector

The goal of this RFE is to provide a common ground layer for all these
Blocks: 75375
Blocks: selectors3
code level bug, qa->engineer
Keywords: css2, css3
QA Contact: ian → attinasi
Whiteboard: [Hixie-PF]
WORK IN PROGRESS : patch showing a way to add support for pseudo-classes with
arguments. I did not try to optimize for the moment so all your suggestions
and comments are **highly** welcome.

Just an extra note : I have used this code for all :nth-*() pseudos w/o problem.
setting this out to future to get it off the un-milestoned list, moving it back 
to the appropriate milestone when you are ready.
Priority: -- → P4
Target Milestone: --- → Future
Daniel: what's the status of this, could you try to get this and the other patch
( bug 75375 ) done?
Just in (an unlikely) case it's overlooked, :lang pseudo-class accepts an
argument in CSS2 as well 
as in CSS3. A couple of simple test pages are put up at
Depends on: 221981
Blocks: 221981
No longer depends on: 221981
Summary: [CSS] RFE : add support for pseudo-classes accepting argument(s) → add support for pseudo-classes accepting argument(s)
Without looking at code for this I think we now support this ability...

Thought taken from the :lang testsuite test for CSS3 Selectors:

Leaving as Assigned since I have no code-knowledge in this area
In addition to 'lang()', 'not()' also works rather well. 
Among test cases listed at ,
tests #54 through #72b work fine. Can anyone identify which checkin(s) fixed
this? If it's done in a generic manner so as to satisfy the goal mentioned in
comment #0, this should be closed, shouldn't it? (and we have to move on to
fixing bug 75375) 
Sorry for spam. 'not()' support had been added before this bug was filed (bug
71647). So, it seems like we still don't have a generic frame work set as the
goal of this bug in comment #0. Or, we may have it but in a different way. 
QA Contact: attinasi → style-system
Apart from :contains() which was removed from the spec Gecko now supports all the selectors listed in the initial comment. --> FIXED?
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.