-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[selectors-4] About shadow-including descendants #1135
Comments
Note that the Blink implementation walks the layout tree for :hover/:active, not the flat tree, so there can be subtleties. I've reported https://crbug.com/705984 for display:contents. Firefox also has an invalidation problem with :hover and display:contents https://bugzilla.mozilla.org/show_bug.cgi?id=1351339 |
This test is similar to the example in w3c/csswg-drafts#1135. It checks that when the slotted element is focused, ":focus-within" pseudo-class affects to the ancentors in the flat tree.
This test is similar to the example in w3c/csswg-drafts#1135. It checks that when the slotted element is focused, ":focus-within" pseudo-class affects to the ancestors in the flat tree.
cc editors @tabatkins @fantasai |
Hm, I didn't realize that "shadow-including descendants" doesn't include that case. That's annoying. The intention is definitely that they run on the flat tree. |
Suggested edit (for all of the relevant classes, and fixing #1141 too):
Sound good? |
Yeah, it sounds good. Thanks @tabatkins! |
…tree They were incorrectly defined as applying to shadow-including descendants, while the intent was for them to work on flat tree descendants Closes w3c#1135
This test is similar to the example in w3c/csswg-drafts#1135. It checks that when the slotted element is focused, ":focus-within" pseudo-class affects to the ancestors in the flat tree.
So this has just been fixed by @tabatkins at 9d0024d Thanks! |
https://bugs.webkit.org/show_bug.cgi?id=170899 Reviewed by Antti Koivisto. Source/WebCore: This has been discussed in the following CSS WG issue: w3c/csswg-drafts#1135 And the spec has been updated (https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo): "An element also matches :focus-within if one of its descendants in the flat tree (including non-element nodes, such as text nodes) matches the conditions for matching :focus." Test: imported/w3c/web-platform-tests/css/selectors4/focus-within-shadow-006.html * dom/Element.cpp: (WebCore::Element::setFocus): Use "flat tree" ("composed tree" in WebKit) to set focus-within flag. LayoutTests: * TestExpectations: Remove test that is passing now. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@215719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
For three pseudo-classes (
:hover
,:active
and:focus-within
) the spec has a similar text: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:
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 theshadowDiv
. Shouldn't the spec mention the flat tree instead?This discussion started on the
blink-dev
thread about:focus-within
.The text was updated successfully, but these errors were encountered: