Support class filtered pseudo classes ps.: first-of type, last-of-type, nth-of-type, etc.

RESOLVED INVALID

Status

()

Core
CSS Parsing and Computation
RESOLVED INVALID
4 years ago
2 years ago

People

(Reporter: hunboy, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 728648 [details]
Testcase

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0
Build ID: 20130307023931

Steps to reproduce:

I've read shortly the w3c recommendations to try to find exlusions for this feature, but haven't found any. Btw any other major browsers don't support this feature either, simply ignores class filtered pseudoclasses.


Actual results:

Based on my testcase, the class filtered pseudoclasses css definitions aren't rendered.


Expected results:

Based on my testcase, all of boxes shoud be same colored than the text says inside
(Reporter)

Updated

4 years ago
Attachment #728648 - Attachment mime type: text/plain → text/html
(Reporter)

Updated

4 years ago
OS: Windows XP → All
Hardware: x86 → All
"type" in these selectors means element type, that is, "div".  So you're asking for the nth-div.

selectors4 has some proposals for what you want, but I don't think they're stable yet.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

4 years ago
Thank You David the fast solving,

although i don't understand in this case why the 
last div is not aqua from div.a:last-of-type {background-color:#00ffff;}, while
the first DIV is red from div.a:first-of-type {background-color:#ff0000;}
and second DIV is green from div.b:nth-of-type(2) {background-color:#00ff00;}

seems partially parses the classnames. Does it worth any effort?
The last div ("should be white") has no classes at all; no other divs match :last-of-type, and it doesn't match .a or .b .

Comment 4

2 years ago
You can use selectors level 4 nth-child(An+B of sel), https://bugzilla.mozilla.org/show_bug.cgi?id=854148
WebKit Nightly supported.
You need to log in before you can comment on or make changes to this bug.