-
Notifications
You must be signed in to change notification settings - Fork 47
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
Guidance about which state properties should be reflected as HTML attributes #289
Comments
I think there is an unresolved issue around The |
I think that's more a comment for #279, though is is certainly related with this. User input already has a defined serialization for |
We discussed this again in today's breakout. We all agree that we don't want any of these two extremes:
It seems that the optimum choices for the Web Platform are somewhere in the middle, but we are having some trouble to zero in on the exact distinction. @plinss came up with a thought experiment, inspired by my point about SSR: If browsers were read-write, what state would you expect to be copied if you copied a part of a webpage? It seems there are aspects of state that are part of the document (i.e. makes more sense to expose) and aspects of state that are external (e.g. hover, focus, |
Resolved in today's breakout: @LeaVerou to write a draft principle based on the first comment so we can have something concrete to debate. |
This came up while reviewing
<popup>
in w3ctag/design-reviews#599 (comment), and more specifically about whether it should have anopen
attribute like<dialog>
and<details>
.There is another issue about keeping IDL attributes and HTML attributes in sync when both exist, but we don't have anything about which IDL attributes should also exist as attributes.
My personal opinion is to err on the side of including attributes for main properties. Providing declarative HTML-based ways to interact with UI controls has several benefits. Off the top of my head:
open
when iterating than to write script)open={{expression}}
) and be handled by any library handling HTML generically.On the other hand, there have been some arguments against this, I believe primarily centered around performance. In the case of
<dialog open>
, things got messy I believe due to some inconsistency with theopen
andclose
events, I'm not sure if there's anything more general to learn from that.Anyhow, I think this is something we should discuss, resolve on so that we're all on the same page, and provide guidance about in the form of a design principle.
The text was updated successfully, but these errors were encountered: