-
Notifications
You must be signed in to change notification settings - Fork 46
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
New principle: HTML attributes can affect semantics #478
Comments
In my mental model pretty much all HTML attributes impact semantics. So I'm not entirely convinced this is needed. (Except for those that are presentational in nature, such as |
@domenic who I think also has thoughts on this discussion. Ok. Perhaps we should talk more specifically about different applications of the concept of semantics. As it relates to
|
The definition of "semantics" can be slippery and confusing in these discussions. At one extreme, you can use the definition of "what is communicated to anyone" (including developers reading the source code). At the other, you can use the most-practical meaning, of "how are accessibility technology behaviors impacted". So for example, a But for HTML attributes in particular, I think that in general many of them don't have meaningful "semantics" in most senses. Attributes are the main customization hook for changing behavior, and we use them as such frequently. Scrolling through https://html.spec.whatwg.org/multipage/indices.html#attributes-3 , some that stick out to me as pretty behavior-focused, where you'd have to really stretch to talk about the impact on semantics:
... I'll stop there. |
But |
I think we should consider adding a design principle covering whether HTML element semantics can be affected by an attribute, and if so in what situations. I'm not totally sure how the principle should be stated, so for now this issue is to track a proposed need, and hopefully we can work towards a definition in the issue.
(Note: currently the web platform design principles only refers to semantics for attributes as it relates to choosing names that relate to semantics.)
Two recent features have bearing on this question:
The
popover
attribute, which currently defines only behaviors of popovers and has no effect on the semantics of the underlying elements. During spec development, there was guidance not to have it affect element semantics, mostly I believe because that would get very complicated to consider the interaction ofpopover
with the semantics of every HTML element.The proposed
switch
attribute for checkbox inputs. This attribute is proposed to change from a checkbox to a switch, which has somewhat different semantics.I'm not sure if there are any other examples of HTML attributes affecting semantics.
The text was updated successfully, but these errors were encountered: