-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
selectors-4Current WorkCurrent Work
Description
For three pseudo-classes (:hover, :active and :focus-within) the spec has a similar text:
An element also matches :hover if one of its shadow-including descendants matches :hover.
The reference to shadow-including descendants was introduced back in April 2016 by @tabatkins.
However it seems it doesn't match the behavior in either Chrome and Safari.
Using an example from @rune-opera:
<div id="host">
<span>Hover me</span>
</div>
<script>
host.attachShadow({mode:"open"}).innerHTML = "<style>#shadowDiv:hover { border: 5px solid green }</style><div id='shadowDiv'><slot></slot></div>";
</script>In both Blink and WebKit a green border appears on the shadowDiv when you hover the <span>. This seems the right behavior from the user point of view.
However, the <span> is not a shadow-including descendant of the shadowDiv. Shouldn't the spec mention the flat tree instead?
This discussion started on the blink-dev thread about :focus-within.
Metadata
Metadata
Assignees
Labels
selectors-4Current WorkCurrent Work