[webkit-changes] [WebKit/WebKit] 008a2e: Selector argument for :nth-of-type or :nth-last-of...

Tim Nguyen noreply at github.com
Tue Jan 3 09:48:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 008a2e643a90d660aca4f029516a4c534e509c3c
      https://github.com/WebKit/WebKit/commit/008a2e643a90d660aca4f029516a4c534e509c3c
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-01-03 (Tue, 03 Jan 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/css/parser/CSSSelectorParser.cpp

  Log Message:
  -----------
  Selector argument for :nth-of-type or :nth-last-of-type should be rejected
https://bugs.webkit.org/show_bug.cgi?id=249990
rdar://103805150

Reviewed by Antti Koivisto.

The selector argument is only valid for :nth-child/:nth-last-child, it does not make sense for :nth-of-type/:nth-last-of-type given
the selector matched is always the tagname (type). WebKit also didn't process the selector argument at matching time for the type selectors.

See https://w3c.github.io/csswg-drafts/selectors/#nth-of-type-pseudo

Test: imported/w3c/web-platform-tests/css/selectors/nth-of-invalid.html

* LayoutTests/TestExpectations:
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):

Canonical link: https://commits.webkit.org/258389@main




More information about the webkit-changes mailing list