Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b3491d4d6d096ce5f143ee36b318e4df108e94cf
https://github.com/WebKit/WebKit/commit/b3491d4d6d096ce5f143ee36b318e4df108e94cf
Author: Alan Baradlay <[email protected]>
Date: 2026-06-01 (Mon, 01 Jun 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-scoping/hover-invalidates-slotted-descendant-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-scoping/hover-invalidates-slotted-descendant.html
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/dom/Document.cpp
Log Message:
-----------
Enhanced <select>: hovering an option does not apply :hover descendant styles
to its content
https://bugs.webkit.org/show_bug.cgi?id=315930
rdar://175273152
Reviewed by Antti Koivisto.
<select style="appearance: base-select">
<option><div class="content"></div></option>
</select>
:is(option):hover .content { border: 5px solid green; }
Hovering an option's content should draw the green border. Instead the box
never changed.
composed hover chain tree scope
<slot> <- restyle root shadow (searched here; rule not in shadow)
option document (author rule lives here)
content <- hovered document
An enhanced select slots its author <option>s into the ::picker shadow tree, so
the
hovered ancestor chain crosses into the shadow scope at the <slot>. The hover
code rooted
its single descendant restyle at the top of that chain (the <slot>) and
searched the slot's
shadow stylesheet, where the rule does not exist, so 'content' was never
invalidated.
Style is resolved per tree scope, so root a descendant invalidation at the top
of each tree
scope the chain crosses, not only at its top. The document-scope element (the
option) is
then invalidated where the rule lives, and 'content' restyles on hover.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scoping/hover-invalidates-slotted-descendant-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scoping/hover-invalidates-slotted-descendant.html:
Added.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
Canonical link: https://commits.webkit.org/314311@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications