Bug 31267 - :nth-child(-2n) should match no element
Summary: :nth-child(-2n) should match no element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 12:45 PST by Jan Kassens
Modified: 2010-05-17 21:49 PDT (History)
3 users (show)

See Also:


Attachments
testcase (787 bytes, text/html)
2009-11-30 04:52 PST, Jan Kassens
no flags Details
Add tests for Bug 31267 - :nth-child(-2n) should match no element. (2.22 KB, patch)
2010-05-16 23:06 PDT, Yuzo Fujishima
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kassens 2009-11-09 12:45:51 PST
:nth-child(-an) matches the a-th element, but should not match anything.

This applies to querySelectorAll and CSS rules.

NOTE:
:nth-child(-n) correctly matches nothing.
Comment 1 Jan Kassens 2009-11-30 04:52:30 PST
Created attachment 44015 [details]
testcase

A simple manual testcase.
Comment 2 Yuzo Fujishima 2010-05-16 23:06:22 PDT
Created attachment 56213 [details]
Add tests for Bug 31267 - :nth-child(-2n) should match no element.
Comment 3 Yuzo Fujishima 2010-05-16 23:10:06 PDT
The proposed patch  just adds tests because this bug has been already fixed by
http://trac.webkit.org/changeset/58300 .
Comment 4 Darin Adler 2010-05-17 10:52:17 PDT
Comment on attachment 56213 [details]
Add tests for Bug 31267 - :nth-child(-2n) should match no element.

Good to add a test case.

A test that replaces "Test didn't run" with "PASS" or "FAIL" isn't quite as good as a test that explains what it's testing. It's better when possible to have the test explain itself and write out specifics of the unwanted result.

r=me
Comment 5 Yuzo Fujishima 2010-05-17 21:46:40 PDT
Committed r59649: <http://trac.webkit.org/changeset/59649>
Comment 6 Yuzo Fujishima 2010-05-17 21:49:22 PDT
Thank you for the review.

Landed the patch after making the tests more descriptive.