Bug 249990 - Selector argument for :nth-of-type or :nth-last-of-type should be rejected
Summary: Selector argument for :nth-of-type or :nth-last-of-type should be rejected
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2023-01-01 20:29 PST by Tim Nguyen (:ntim)
Modified: 2023-01-03 09:48 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2023-01-01 20:29:34 PST
Apparently :nth-of-type(n of S) parses and also has associated matching logic. Ditto for :nth-last-of-type().

https://github.com/web-platform-tests/wpt/blob/add22a2f6c1f9efcc1eccc66b3e9ea9e8045a4b5/css/selectors/nth-of-007.html

The spec says it should not be supported: https://w3c.github.io/csswg-drafts/selectors/#nth-of-type-pseudo
Comment 1 Radar WebKit Bug Importer 2023-01-01 20:30:11 PST
<rdar://problem/103805150>
Comment 2 Tim Nguyen (:ntim) 2023-01-01 21:19:02 PST
This WPT now covers it: css/selectors/nth-of-invalid.html
Comment 3 Tim Nguyen (:ntim) 2023-01-02 22:53:14 PST
Pull request: https://github.com/WebKit/WebKit/pull/8140
Comment 4 EWS 2023-01-03 09:48:22 PST
Committed 258389@main (008a2e643a90): <https://commits.webkit.org/258389@main>

Reviewed commits have been landed. Closing PR #8140 and removing active labels.