-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
consider whether we should have implementation or authoring requirements for nested <details name=...> #9968
Comments
here's the link to the codepen i shared with David: https://codepen.io/scottohara/pen/abXRJZL |
I agree. I don’t know whether there are any actual use cases for intentionally nesting one And given that, the HTML checker (validator) could be helpful to developers in such cases — by emitting an error to alert them of the likely mistake. But in order for the HTML checker to emit an error for it, the spec would need to be updated to explicitly define it as a conformance error — that is, (2).
I would object to doing (3) unless someone can describe a compelling use case for ever nesting one It’s worth mentioning that the current behavior (that if you try to open the inner details element, then the outer one that contains it will close) is actually well-defined — I mean, as opposed to being undefined behavior. It’s clear that behavior isn’t desirable or useful for anything — but I think it would only be surprising to anybody in practice if they actually had some good reason for nesting the elements that way, and were doing it intentionally (rather than just testing it to see what would happen). |
Add pagereveal event The pagereveal event is fired at the beginning of the first rendering opportunity after activation (initial load or reactivation). It is a way for the author to execute some JS that affects the presentation "just in time" for the first frame. If there is an inbound cross-document view transition, the reveal event holds a reference to the ViewTransition object. Closes whatwg#9315. Use UA styles rather than prose to define <input> clip The previous prose to make `overflow` act as `visible` with regards to other CSS features but still clip didn't work well with e.g. `text-overflow: ellipsis`. CSS now has a standard way to do what `input` buttons need, i.e. clip and also not affect interaction with `vertical-align`. Fixes whatwg#9976. Forbid nesting <details> in the same exclusive accordion Fixes whatwg#9968.
What is the issue with the HTML Standard?
One thing I didn't consider when we specified
<details name=...>
is that it's possible to nest onedetails
element with the same name inside of another. @scottaohara just got some feedback from somebody recently who tried this, and it does lead to surprising results. In particular, if you try to open the inner details element, then the outer one that contains it will close. This is certainly surprising.I think there are a few things we could do about this:
details
elements with the samename
details
with aname
closes all other details except for any that contain it)... which does require then going back and handling the possibility in other cases that there's more than one opendetails
in a groupI think I probably don't want to do (3) but I think (2) may be reasonable.
The text was updated successfully, but these errors were encountered: