Skip to content

[:has()] Fix failures in css/selectors/invalidation/has-invalidation-first-in-sibling-chain.html WPT#63782

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
anttijk:has-sibling-flag-reset
Apr 28, 2026
Merged

[:has()] Fix failures in css/selectors/invalidation/has-invalidation-first-in-sibling-chain.html WPT#63782
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
anttijk:has-sibling-flag-reset

Conversation

@anttijk
Copy link
Copy Markdown
Contributor

@anttijk anttijk commented Apr 28, 2026

45d24e3

[:has()] Fix failures in css/selectors/invalidation/has-invalidation-first-in-sibling-chain.html WPT
https://bugs.webkit.org/show_bug.cgi?id=313527
rdar://175738008

Reviewed by Alan Baradlay.

Sibling relation bits for :has() can't be reset normally before resolving a subtree because they can get
set for any element at any point of style resolution.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-invalidation-first-in-sibling-chain-expected.txt:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::resetStyleRelations):
(WebCore::Element::resetAllDescendantStyleRelations):
(WebCore::Element::resetHasSiblingFlags):
* Source/WebCore/dom/Element.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resetDescendantStyleRelations):

Fix by only reseting in case of a full style rebuild from root.

* Source/WebCore/style/StyleTreeResolver.h:

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

f1e38bc

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ⏳ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@anttijk anttijk requested review from cdumez and rniwa as code owners April 28, 2026 10:03
@anttijk anttijk self-assigned this Apr 28, 2026
@anttijk anttijk added the CSS Cascading Style Sheets implementation label Apr 28, 2026
@anttijk anttijk added the merge-queue Applied to send a pull request to merge-queue label Apr 28, 2026
…first-in-sibling-chain.html WPT

https://bugs.webkit.org/show_bug.cgi?id=313527
rdar://175738008

Reviewed by Alan Baradlay.

Sibling relation bits for :has() can't be reset normally before resolving a subtree because they can get
set for any element at any point of style resolution.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-invalidation-first-in-sibling-chain-expected.txt:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::resetStyleRelations):
(WebCore::Element::resetAllDescendantStyleRelations):
(WebCore::Element::resetHasSiblingFlags):
* Source/WebCore/dom/Element.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resetDescendantStyleRelations):

Fix by only reseting in case of a full style rebuild from root.

* Source/WebCore/style/StyleTreeResolver.h:

Canonical link: https://commits.webkit.org/312221@main
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 312221@main (45d24e3): https://commits.webkit.org/312221@main

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

@webkit-commit-queue webkit-commit-queue merged commit 45d24e3 into WebKit:main Apr 28, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants