Skip to content
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

Remove the deprecated name attribute on HTML anchor elements #1870

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Jun 14, 2024

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

Fixes: matrix-org#1790
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if deprecation is the correct classification for this since we're removing it without deprecating it. However, none of the other categories from https://github.com/matrix-org/matrix-spec/blob/main/CONTRIBUTING.rst#adding-to-the-changelog seemed fitting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a "Removed" section, which isn't listed in the CONTRIBUTING.rst

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. I have opened #1907 to add it to the contribution guide.

Thanks also for adding the MSC to the changelog. I had totally forgotten about that. 🤦‍♂️

@Johennes Johennes marked this pull request as ready for review June 14, 2024 11:00
@Johennes Johennes requested a review from a team as a code owner June 14, 2024 11:00
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is imported from Vector, which is before even my time with Matrix. I'm not sure why it was included, or what value it has being included.

From a spec process perspective, I think we'd need to see the WHATWG spec on this deprecation before we can meaningfully decide if it needs an MSC. I suspect this PR will probably need an MSC if the feature is being removed with no replacement. From MSC4077 (ref):

It is left to the discretion of the spec PR reviewer as to whether an MSC is required. In general, an MSC should be requested when the replacement HTML feature is not quite the same as the old feature. The reviewer may also decide whether to keep supporting the old, deprecated, feature for some time. For example, replacing strike with s may mean that both tags are supported for 1-2 Matrix spec versions before strike can be dropped.

content/client-server-api/modules/instant_messaging.md Outdated Show resolved Hide resolved
Co-authored-by: Travis Ralston <travpc@gmail.com>
@Johennes
Copy link
Contributor Author

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
Copy link
Contributor Author

Johennes commented Jun 14, 2024

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.

@turt2live turt2live self-requested a review June 14, 2024 20:01
Co-authored-by: Travis Ralston <travpc@gmail.com>
@Johennes
Copy link
Contributor Author

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

@turt2live
Copy link
Member

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

@Johennes Johennes marked this pull request as draft June 20, 2024 10:51
@Johennes
Copy link
Contributor Author

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

@Johennes
Copy link
Contributor Author

This is now blocked on matrix-org/matrix-spec-proposals#4159

@Johennes
Copy link
Contributor Author

Johennes commented Jul 8, 2024

Undrafting since the MSC has been merged.

@Johennes Johennes requested a review from turt2live July 8, 2024 14:53
@uhoreg uhoreg merged commit b1349dd into matrix-org:main Jul 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

anchor tag name attribute is deprectated
3 participants