@@ -1107,6 +1107,8 @@ pub enum Component<'i, Impl: SelectorImpl<'i>> {
11071107 Scope ,
11081108 NthChild ( i32 , i32 ) ,
11091109 NthLastChild ( i32 , i32 ) ,
1110+ NthCol ( i32 , i32 ) , // https://www.w3.org/TR/selectors-4/#the-nth-col-pseudo
1111+ NthLastCol ( i32 , i32 ) , // https://www.w3.org/TR/selectors-4/#the-nth-last-col-pseudo
11101112 NthOfType ( i32 , i32 ) ,
11111113 NthLastOfType ( i32 , i32 ) ,
11121114 FirstOfType ,
@@ -1604,10 +1606,12 @@ impl<'i, Impl: SelectorImpl<'i>> ToCss for Component<'i, Impl> {
16041606 FirstOfType => dest. write_str ( ":first-of-type" ) ,
16051607 LastOfType => dest. write_str ( ":last-of-type" ) ,
16061608 OnlyOfType => dest. write_str ( ":only-of-type" ) ,
1607- NthChild ( a, b) | NthLastChild ( a, b) | NthOfType ( a, b) | NthLastOfType ( a, b) => {
1609+ NthChild ( a, b) | NthLastChild ( a, b) | NthOfType ( a, b) | NthLastOfType ( a, b) | NthCol ( a , b ) | NthLastCol ( a , b ) => {
16081610 match * self {
16091611 NthChild ( _, _) => dest. write_str ( ":nth-child(" ) ?,
16101612 NthLastChild ( _, _) => dest. write_str ( ":nth-last-child(" ) ?,
1613+ NthCol ( _, _) => dest. write_str ( ":nth-col(" ) ?,
1614+ NthLastCol ( _, _) => dest. write_str ( ":nth-last-col(" ) ?,
16111615 NthOfType ( _, _) => dest. write_str ( ":nth-of-type(" ) ?,
16121616 NthLastOfType ( _, _) => dest. write_str ( ":nth-last-of-type(" ) ?,
16131617 _ => unreachable ! ( ) ,
@@ -2381,8 +2385,10 @@ where
23812385{
23822386 match_ignore_ascii_case ! { & name,
23832387 "nth-child" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthChild ) ,
2384- "nth-of-type" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthOfType ) ,
23852388 "nth-last-child" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthLastChild ) ,
2389+ "nth-col" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthCol ) ,
2390+ "nth-last-col" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthLastCol ) ,
2391+ "nth-of-type" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthOfType ) ,
23862392 "nth-last-of-type" => return parse_nth_pseudo_class( parser, input, * state, Component :: NthLastOfType ) ,
23872393 "is" if parser. parse_is_and_where( ) => return parse_is_or_where( parser, input, state, Component :: Is ) ,
23882394 "where" if parser. parse_is_and_where( ) => return parse_is_or_where( parser, input, state, Component :: Where ) ,
0 commit comments