Re: [csswg-drafts] [css-ui] select:hover and select:active styles (#11185)

After a decent amount of private back and forth with @dbaron, I think I agree with the proposed wording. Perhaps it was only me that missed a few things, but just in case, here are some notes:

> An element E also matches [:hover](https://drafts.csswg.org/selectors/#hover-pseudo) if one of its descendants D in the [flat tree](https://drafts.csswg.org/css-scoping-1/#flat-tree) (including non-element nodes, such as text nodes) matches the above conditions,

Same wording as existing spec, but with D and E defined.

> and neither D, nor any of D's flat tree ancestors that are flat tree descendants of E, is in the [top layer](https://drafts.csswg.org/css-position-4/#document-top-layer).

- An element is ["in the top layer"](https://drafts.csswg.org/css-position-4/#document-top-layer) if it is one of the elements in the top layer set. Note that a descendant of a top layer element is therefore not automatically "in the top layer", unless it is separately placed there (e.g. nested popovers).
- ["top layer root"](https://drafts.csswg.org/css-position-4/#top-layer-root) is defined, perhaps unfortunately, as a **non-inclusive** ancestor that is in the top layer. So each of the elements in the top layer doesn't have itself as its top layer root.  (Note that "ancestor" isn't linked in CSS to a definition, so I'm using [DOM's definition of the term](https://dom.spec.whatwg.org/#concept-tree-ancestor).)
- ["in the same top layer"](https://drafts.csswg.org/css-position-4/#in-the-same-top-layer) means two elements share the same top layer root.
- The above two mean that if E is an element [in the top layer](https://drafts.csswg.org/css-position-4/#document-top-layer), then "E isn't in the same top layer as E".
- @dbaron's proposed wording gets around this by explicitly checking ancestors and descendants to make sure D is contained within the nearest **inclusive** top layer root.

I think perhaps it might be a better idea to try to fix up at least the non-inclusiveness of "top layer root"?

-- 
GitHub Notification of comment by mfreed7
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11185#issuecomment-2539486726 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 12 December 2024 16:50:38 UTC