Closed Bug 854125 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: hunboy, Unassigned)

Details

Attachments

(1 file)

Attached file 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
Attachment #728648 - Attachment mime type: text/plain → text/html
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
Closed: 13 years ago
Resolution: --- → INVALID
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 .
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.

Attachment

General

Created:
Updated:
Size: