Bug 21815 - CSSNthSelector parsing code is illegible and buggy (allows "n3" as a valid selector)
Summary: CSSNthSelector parsing code is illegible and buggy (allows "n3" as a valid se...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-22 16:04 PDT by Eric Seidel (no email)
Modified: 2022-08-08 11:20 PDT (History)
7 users (show)

See Also:


Attachments
Code changes, tests coming soon (4.49 KB, patch)
2008-10-23 12:33 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-10-22 16:04:48 PDT
CSSNthSelector parsing code is illegible and wrong (allows "n3" as a valid selector)

Ojan pointed out to me that this code was completely unreadable.  When I went to clean it up, I found a bug.  Patch forthcoming.
Comment 1 Eric Seidel (no email) 2008-10-22 17:53:23 PDT
Sam points out that my use of "wrong" might imply that the code itself was completely incorrect.  That was certainly not the case.  It simply has a few strictness bugs, which I found when trying to understand what it was doing.
Comment 2 Eric Seidel (no email) 2008-10-23 12:33:39 PDT
Created attachment 24608 [details]
Code changes, tests coming soon

 WebCore/css/CSSNthSelector.cpp |  105 ++++++++++++++++++++++++++--------------
 WebCore/css/CSSSelector.h      |    1 +
 2 files changed, 70 insertions(+), 36 deletions(-)
Comment 3 Yael 2011-01-06 06:00:54 PST
The patch I just uploaded to https://bugs.webkit.org/show_bug.cgi?id=51231 should also fix this bug. (The ns part of it).
Since the class CSSNthSelector no longer exists, should this bug be marked as duplicate of bug 51231 ?
Comment 4 Ahmad Saleem 2022-08-07 04:52:10 PDT
Is this fixed as part of bug 51231?
Comment 5 Ryosuke Niwa 2022-08-07 10:25:05 PDT
We've since rewritten CSS parser by adopting Blink's.