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

html.img: Remove phantom onerror deprecation #21783

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Dec 30, 2023

Summary

This PR removes the deprecation annotation from the onerror attribute of the HTML img tag's browser compatibility data.

Test results and supporting details

Original source of existing data

Related issues

Commit message body

The onerror attribute to the img element has been marked deprecated since the table data was introduced in 061483a. However, that deprecation was never sourced to any specs or references, and multiple inquiries since have failed to uncover any explanation for it. It appears to have been a simple error.

The `onerror` attribute to the `img` element has been marked
deprecated since the table data was introduced in 061483a.
However, that deprecation was never sourced to any specs or
references, and multiple inquiries since have failed to uncover
any explanation for it. It appears to have been a simple error.
@github-actions github-actions bot added the data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML label Dec 30, 2023
@teoli2003
Copy link
Member

I think the current rule is not to list onXYZ content attribute (and so the whole entry should be removed).

Let's double-check this with @queengooborg or @Elchi3.

@queengooborg
Copy link
Collaborator

Actually, the rule is not to document event handler attributes on the interface, not the HTML attribute. For the most part, I think we've been keeping the HTML attributes for event handlers?

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Dec 31, 2023

Another data point:

onerror is discussed in § Image Loading Errors of the MDN article on the <img> element (to which the compatibility chart built from this data is attached), with no mention made of any deprecation.

This is in contrast to every other attribute marked as deprecated in the chart data, which are all gathered together in § Deprecated Attributes of the article.

@teoli2003
Copy link
Member

Actually, the rule is not to document event handler attributes on the interface, not the HTML attribute. For the most part, I think we've been keeping the HTML attributes for event handlers?

In that case, we have 100s of "onXYZ" missing on elements. For example, onclick works on the <img> element (even if it is not recommended).

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jan 2, 2024

@teoli2003

In that case, we have 100s of "onXYZ" missing on elements. For example, onclick works on the <img> element (even if it is not recommended).

It's possible the idea was that the compatibility chart should provide information on whatever's discussed in the article. Like I said, onerror is mentioned in the error-handling section, none of the other event triggers are.

Personally it doesn't matter to me whether it gets removed or fixed. I just want to stop claiming it's deprecated when it's not.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

I don't think it is useful to have all the event handlers in the HTML compat data, so this data might get removed, but for now the PR is correct as it stands. The onerror event handler is not deprecated.

@Elchi3 Elchi3 merged commit 293857c into mdn:main Jan 2, 2024
6 checks passed
@ferdnyc ferdnyc deleted the ferdnyc-patch-1 branch January 2, 2024 14:12
@skyclouds2001
Copy link
Contributor

I searched in the repo, and it seems that this is the only event handler property listed in the html part of the BCD

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants