Re: [csswg-drafts] [css-display] Interaction gotchas when delaying the effect of `display: none` (#8389)

The CSS Working Group just discussed ``[css-display] Interaction gotchas when delaying the effect of `display: none` ``, and agreed to the following:

* `RESOLVED: inertness is determined by the base computed style for 'display', resulting in animations to 'none' being considered inert`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> flackr: Using display to animate from block to none<br>
&lt;fantasai> flackr: this has effect that during animation, the element can still be interacted with and is in the a11y tree<br>
&lt;fantasai> flackr: it has problems with e.g. form submission, coudl accidentally submit twice because animating out<br>
&lt;fantasai> flackr: proposed resolution is that we look at the base value of the display property, i.e. the value before animation is apply<br>
&lt;fantasai> flackr: when animating to none, base value woudl be none<br>
&lt;fantasai> flackr: use that to determine whether the element should be in the a11y tree<br>
&lt;fantasai> flackr: and also effectively make it inert while it's none<br>
&lt;fantasai> flackr: longer-term, we might want to have inert be a CSS property, and this would be part of auto behavior for inert<br>
&lt;PaulG> +1 (from APA_<br>
&lt;TabAtkins> +1 frome me<br>
&lt;fantasai> flackr: but this would be for doing the right thing in the simple cases<br>
&lt;masonf> +1<br>
&lt;fantasai> +1 to "make it work like expected without author fussing"<br>
&lt;bramus> +1<br>
&lt;emilio> +1 as long as there are tests for this<br>
&lt;fantasai> flackr: [re-explains proposal]<br>
&lt;fantasai> Rossen: There was some work that was already happening around inert, curious if your proposal has any tracking with that work<br>
&lt;emilio> q+<br>
&lt;fantasai> Rossen: I'm sure inert as CSS property was considered and debated at some point in the past, I'm not sure where we ended up, but would be good to have a tracking issue or at least track that discussion<br>
&lt;chrishtr> Link to prior discussion: https://github.com/w3c/csswg-drafts/issues/8389#issuecomment-1419970151<br>
&lt;fantasai> chrishtr: Link to pros and cons<br>
&lt;fantasai> chrishtr: my understanding from previous discussion was that no one had strong opinions, and the door was open to adding it in the future<br>
&lt;fantasai> Rossen: that answers my question<br>
&lt;fantasai> chrishtr: We can do this thing for now, so by default it does the right thing<br>
&lt;fantasai> chrishtr: and if there's significant developer need, we can add 'inert' in the future without too much trouble<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> flackr: yes, this is designed to be forwards-compatible with that<br>
&lt;fantasai> emilio: I was thinking about this, inert has this feature where some elements that escape inert-ness<br>
&lt;fantasai> emilio: e.g. modal dialog that's now 'display: none', that will not be inert<br>
&lt;fantasai> emilio: but 'display: none' would prevent modal dialog from showing<br>
&lt;flackr> qq+<br>
&lt;fantasai> emilio: this looks almost like inert, but with that thing where we may not want subtrees to escape inertness?<br>
&lt;fantasai> chrishtr: if you have [scenario]<br>
&lt;astearns> ack flackr<br>
&lt;Zakim> flackr, you wanted to react to emilio<br>
&lt;fantasai> flackr: the auto behavior is based on the computed base style of 'display', which even for the descendant would be 'none'<br>
&lt;fantasai> emilio: not really, display is not inherited<br>
&lt;fantasai> flackr: but it's within an element with a computed base display style of 'none'<br>
&lt;TabAtkins> display may not be inherited, but display-none-ness *basically* is<br>
&lt;masonf> modal dialog inside a display:none subtree is already display:none.<br>
&lt;fantasai> emilio: the way inert is implemented, at least in WebKit and Gecko, basically it's an internal inherited bit in the computed style representation<br>
&lt;fantasai> emilio: there are things that can flip that for a subtree<br>
&lt;fantasai> emilio: when you have fullscreen element, everything is inert except fullscreen element subtree<br>
&lt;oriol> Blink also uses that approach<br>
&lt;fantasai> emilio: this inert, we don't want it to be overridden by anything inside the subtree<br>
&lt;fantasai> flackr: even if overridden, this proposal would fix the common cases<br>
&lt;fantasai> flackr: but if we did allow overriding, you would have these edge cases where the things animating to 'display: none' would not include modal dialog<br>
&lt;fantasai> emilio: this proposal helps a lot for ?? cases<br>
&lt;fantasai> emilio: just an edge case that might be better to explicitly point out?<br>
&lt;fantasai> emilio: "inert, but actually force inertness for the entire subtree"<br>
&lt;fantasai> flackr: sounds like something we could consider if we add a CSS property for inertness<br>
&lt;fantasai> flackr: I think there are use cases for opting subtree<br>
&lt;fantasai> emilio: if we add inert, it would be similar to visibility, can set it differently inside a subtree<br>
&lt;fantasai> emilio: might have use cases for inert unable to flip within the subtree<br>
&lt;fantasai> emilio: probably the spec should call out this edge case, and define the behavior explicitly<br>
&lt;astearns> ack fantasai<br>
&lt;fantasai> emilio: if you have fullscreen element inside, define that behavior<br>
&lt;emilio> fantasai: for visibility: hidden you can flip back to visible, but visibility: collapse into a flex item doesn't allow you to do that<br>
&lt;fantasai> astearns: ready to resolve?<br>
&lt;emilio> ... so visibility has that behavior as well<br>
&lt;fantasai> s/.../fantasai:/<br>
&lt;fantasai> flackr: inertness is determined by the base computed style for 'display', resulting in animations to 'none' being considered inert<br>
&lt;fantasai> astearns: can make that claim generally, not just during animations?<br>
&lt;fantasai> flackr: base computed style is all styles before animations<br>
&lt;fantasai> astearns: any other comments or concerns?<br>
&lt;fantasai> RESOLVED: inertness is determined by the base computed style for 'display', resulting in animations to 'none' being considered inert<br>
&lt;fantasai> astearns: +1 to having tests for this<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8389#issuecomment-1460542364 using your GitHub account


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

Received on Wednesday, 8 March 2023 17:29:30 UTC