Bug 86706

Summary: Parsing of :nth-* pseudo-classes should accept strings starting with "+n"
Product: WebKit Reporter: Kang-Hao (Kenny) Lu <kennyluck>
Component: CSSAssignee: Kang-Hao (Kenny) Lu <kennyluck>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, macpherson, menard, shanestephens, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.w3.org/TR/selectors/#nth-child-pseudo
Attachments:
Description Flags
proposed patch darin: review+

Kang-Hao (Kenny) Lu
Reported 2012-05-16 22:47:57 PDT
E.g. "+n" or "+n+2" or "+n-2". Right now the tokenizer in CSSParser.cpp already accepts this (with a comment saying 'Simplest case. "+[0-9]*n" is always NthChild'), but the microparser in CSSSelector.cpp doesn't.
Attachments
proposed patch (3.92 KB, patch)
2012-05-16 23:51 PDT, Kang-Hao (Kenny) Lu
darin: review+
Kang-Hao (Kenny) Lu
Comment 1 2012-05-16 23:51:09 PDT
Created attachment 142425 [details] proposed patch
Darin Adler
Comment 2 2013-01-16 15:13:37 PST
Comment on attachment 142425 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=142425&action=review > LayoutTests/fast/css/nth-child-unary-prefix.html:4 > <title>CSS Test: :nth-child selector with unary prefix on step</title> Really lame that this test writes nothing to reflect the tests it does; just says “Pass”. That’s not our best practice for regression tests.
Brent Fulgham
Comment 3 2022-07-13 09:55:28 PDT
WebKit appears to have separately added tests for nth-child(+n), which are passing, so I believe this is complete.
Note You need to log in before you can comment on or make changes to this bug.