[Bug 17158] Remove the <legend> tag and add it as an attribute to <fieldset> Example <fieldset legend="Personal information">

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17158

--- Comment #4 from Fred <eldmannen+w3@gmail.com> 2012-05-28 09:29:19 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > The <legend> is an unnecessary tag, it just clutters the tag namespace and
> > makes it harder learn HTML.
> 
> It's necessary to give a title to fieldsets.

Indeed it is, but it should be set through an attribute, not another (nested)
element.

> 
> > It is only used in <fieldset> so instead of having a separate tag, it should be
> > an attribute of fieldset.
> 
> Attributes can't contain markup. Also, this change wouldn't be backwards
> compatible.

Oh, so the reason for the legend tag is so there is a way to add markup to it?
Sorry, this was not something I failed to consider.

Admittedly it does break backwards compatibility, I am aware of that, but on
the other hand it feels cleaner.

> 
> > Having legend as an attribute of fieldset instead of as a separate take makes
> > more sense, makes learning HTML easier, removes unnecessary tags that clutter,
> > provides a cleaner DOM and allows autocompletion.
> 
> I don't see how it does any of those things.

Easier to learn because there would be one less tag to learn.

Cleaner DOM because one less element in the DOM.

An IDE could provide autocompletion/autosuggestion for the legend attribute
when opening the fieldset tag.
Legend would be local to fieldset and not global as it is now.

> 
> > It also makes it more semantically correct because it is paired explicitly with
> > the fieldset tag.
> 
> The semantics would be the same.

No, because now there is no coupling.
fieldset and legend are not semantically coupled together, even though they are
used together, so it lacks semantics.
But if legend were an attribute of fieldset, then then legend would be coupled
to fieldset, and hence there would be a semantic coupling between the two.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 28 May 2012 09:29:27 UTC