Last Comment Bug 854148 - Support for nth-child(An+B of sel) , nth-last-child(An+B of sel) pseudo classes
: Support for nth-child(An+B of sel) , nth-last-child(An+B of sel) pseudo classes
Status: NEW
: dev-doc-needed
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
-- enhancement with 17 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Jet Villegas (:jet)
Mentors:
: 1238864 (view as bug list)
Depends on:
Blocks: selectors4 css3test 1230801
  Show dependency treegraph
 
Reported: 2013-03-23 17:22 PDT by Robert Utasi [:hunboy]
Modified: 2017-06-20 11:35 PDT (History)
12 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase simplified (doesn't contain an+b variants) (1.91 KB, text/html)
2013-03-23 17:22 PDT, Robert Utasi [:hunboy]
no flags Details
testcase simplified (doesn't contain an+b variants) (1.61 KB, text/html)
2014-06-20 21:13 PDT, Robert Utasi [:hunboy]
no flags Details

Description User image Robert Utasi [:hunboy] 2013-03-23 17:22:04 PDT
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
Comment 1 User image Robert Utasi [:hunboy] 2014-06-20 21:10:58 PDT
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."
Comment 2 User image Robert Utasi [:hunboy] 2014-06-20 21:13:52 PDT
Created attachment 8443862 [details]
testcase simplified (doesn't contain an+b variants)

upgrading testcase based on changes
Comment 4 User image Boris Zbarsky [:bz] (if a patch has no decent message, automatic r-) 2016-01-12 11:34:16 PST
*** Bug 1238864 has been marked as a duplicate of this bug. ***
Comment 5 User image Binyamin 2016-01-12 14:52:25 PST
Additional testcase https://output.jsbin.com/meliga/quiet
Comment 6 User image jdscharett 2017-02-03 07:03:54 PST
Any timeframe at when this might be implemented?

Note You need to log in before you can comment on or make changes to this bug.