Support for nth-child(An+B of sel) , nth-last-child(An+B of sel) pseudo classes

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
--
enhancement
5 years ago
2 months ago

People

(Reporter: hunboy, Unassigned)

Tracking

(Blocks: 3 bugs, {dev-doc-needed})

Trunk
dev-doc-needed
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
Created attachment 728673 [details]
testcase simplified (doesn't contain an+b variants)

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

Steps to reproduce:






Expected results:

Based on discussion at Bug 854125
and following w3c selectors level 4 draft
http://dev.w3.org/csswg/selectors4/#the-nth-match-pseudo

implement nth-match, nth-last-match pseudo classes
(Reporter)

Updated

5 years ago
OS: Windows XP → All
Hardware: x86 → All
(Reporter)

Updated

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

Updated

5 years ago
Component: General → Style System (CSS)
Blocks: 693083
(Reporter)

Updated

5 years ago
Severity: normal → enhancement
(Reporter)

Updated

4 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Updated

4 years ago
Version: unspecified → Trunk
(Reporter)

Comment 1

3 years ago
The sel4draft has been changed, nth-match, nth-last-match was removed and feature merged to nth-child with this syntax: nth-child(An+B of sel) where sel is a list of selectors

http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo

"By passing a selector argument, we can select the Nth element that matches that selector. For example, the following selector matches the first three “important” list items, denoted by the .important class:

li:nth-child(-n+3 of .important)

Note that this is different from moving the selector outside of the function, like:

li.important:nth-child(-n+3)

This selector instead just selects the first three list items if they also have the .important class."
Summary: Support for nth-match, nth-last-match pseudo classes → Support for nth-child(An+B of sel) , nth-last-child(An+B of sel) pseudo classes
(Reporter)

Comment 2

3 years ago
Created attachment 8443862 [details]
testcase simplified (doesn't contain an+b variants)

upgrading testcase based on changes
Attachment #728673 - Attachment is obsolete: true

Comment 3

2 years ago
WebKit support: 

https://bugs.webkit.org/show_bug.cgi?id=136845
https://bugs.webkit.org/show_bug.cgi?id=137593
Duplicate of this bug: 1238864

Comment 5

2 years ago
Additional testcase https://output.jsbin.com/meliga/quiet

Updated

a year ago
Blocks: 1230801
Keywords: dev-doc-needed

Updated

a year ago

Comment 6

7 months ago
Any timeframe at when this might be implemented?
Blocks: 913153
You need to log in before you can comment on or make changes to this bug.