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 of popover 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.
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
popoverattribute, 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 ofpopoverwith the semantics of every HTML element.The proposed
switchattribute 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.