Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 748f060a3b77ae67930d9c71ff5c3f159ab51c9a
https://github.com/WebKit/WebKit/commit/748f060a3b77ae67930d9c71ff5c3f159ab51c9a
Author: Anne van Kesteren <[email protected]>
Date: 2026-07-03 (Fri, 03 Jul 2026)
Changed paths:
M
LayoutTests/fast/selectors/nth-last-child-cannot-match-during-parsing-1-expected.txt
M
LayoutTests/fast/selectors/nth-last-child-cannot-match-during-parsing-1.html
M
LayoutTests/fast/selectors/nth-last-child-of-cannot-match-during-parsing-1-expected.txt
M
LayoutTests/fast/selectors/nth-last-child-of-cannot-match-during-parsing-1.html
A
LayoutTests/imported/w3c/web-platform-tests/css/selectors/child-indexed-during-parse-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/selectors/child-indexed-during-parse.html
M Source/WebCore/css/SelectorChecker.cpp
M Source/WebCore/cssjit/SelectorCompiler.cpp
Log Message:
-----------
:last-child and friends should not gate on parser state outside style
resolution
https://bugs.webkit.org/show_bug.cgi?id=315904
Reviewed by Antti Koivisto.
SelectorChecker and the selector JIT forced :last-child, :last-of-type,
:only-child, :only-of-type, :nth-last-child, and :nth-last-of-type to
return false whenever the candidate's parent had not yet finished
parsing children. While matching Chromium as an optimization for
style-resolution, it does not for querySelector().
This is the real reason a subtest in
imported/w3c/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-009.html
fails. Bug 315847 also addresses it by fixing a different bug, but does
not fix the root cause.
Test:
imported/w3c/web-platform-tests/css/selectors/child-indexed-during-parse.html
Upstream: https://github.com/web-platform-tests/wpt/pull/60294
Canonical link: https://commits.webkit.org/316495@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications