matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
170 stars 90 forks source link

Remove the deprecated name attribute on HTML anchor elements #1870

Open Johennes opened 2 weeks ago

Johennes commented 2 weeks ago

The name attribute has been allowed since the r0.4.0 and was introduced with https://github.com/matrix-org/matrix-spec-proposals/pull/1562/files#diff-f90b924249c2799cc2d7eb25cba5418fa8b0412dc3b8a3f176964dab7b2d789bR88.

It has since been deprecated:

Was required to define a possible target location in a page. In HTML 4.01, id and name could both be used on <a>, as long as they had identical values.

Note: Use the global attribute id instead.

I think we should not allow clients to render HTML IDs from external content. So the only possible way forward appears to be removing the name attribute without a replacement.

CC @turt2live in case you recall the use case that led to name being permitted.

Fixes: #1790

Pull Request Checklist

Preview: https://pr1870--matrix-spec-previews.netlify.app

Johennes commented 2 weeks ago

WHATWG tracks it as obsolete: https://html.spec.whatwg.org/multipage/obsolete.html#obsolete-but-conforming-features

Authors should not specify the name attribute on a elements. If the attribute is present, its value must not be the empty string and must neither be equal to the value of any of the IDs in the element's tree other than the element's own ID, if any, nor be equal to the value of any of the other name attributes on a elements in the element's tree. If this attribute is present and the element has an ID, then the attribute's value must be equal to the element's ID. In earlier versions of the language, this attribute was intended as a way to specify possible targets for fragments in URLs. The id attribute should be used instead.

Johennes commented 2 weeks ago

I'm happy to propose the removal as an MSC first if that is required. I'm not sure what the name attribute could ever have been used for but if we're unsure, an MSC might help get further perspectives on that.

Johennes commented 1 week ago

@turt2live would you like this to go through an MSC before continuing here?

turt2live commented 1 week ago

I think so, yes. We can try to fast track the decision making on it though to avoid process burden.

Johennes commented 1 week ago

Ok, no problem. I'll try to get a short proposal up.

Johennes commented 1 week ago

This is now blocked on https://github.com/matrix-org/matrix-spec-proposals/pull/4159