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

img tag / HTMLImageElement error event seems fine everywhere? #6395

Closed
thw0rted opened this issue Jul 14, 2020 · 13 comments
Closed

img tag / HTMLImageElement error event seems fine everywhere? #6395

thw0rted opened this issue Jul 14, 2020 · 13 comments
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@thw0rted
Copy link

thw0rted commented Jul 14, 2020

The data for the error event / onerror property says that most desktop browsers (at least IE, Edge, Chrome) have no support, and FF has only supported it since v51. I don't have any historical data about this, but I tested those 3 browsers today and they all work fine. I also can't find any notes anywhere online saying that support was added in a particular version, so I suspect that the event may have been supported all along and that #388 just had the wrong data to start with.

cc: @teoli2003 , @Elchi3 maybe?

Ref: #4724

@queengooborg queengooborg added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jul 14, 2020
@jpmedley
Copy link
Contributor

I don't follow. html/elements/img.json currently shows true for onerror in Chrome and ≤79 for Edge.

@thw0rted
Copy link
Author

I came here from the relevant caniuse page as well as the MDN docs page for HTMLImageElement. I was under the impression that this repo contained the backing data for those pages. And in the later PR I referenced I saw

"error_event": {
        "__compat": {
          "mdn_url": "https://developer.mozilla.org/docs/Web/API/HTMLImageElement/error_event",
          "description": "<code>error</code> event",
          "support": {
            "chrome": {
              "version_added": false
            },

Does that false mean that Chrome does not have support for error_event?

I'm sorry I'm not really familiar with the process here, so I don't know how the file I linked (api/HTMLImageElement.json) relates to the one you're referring to.

@jpmedley
Copy link
Contributor

Usually it does. In this case, it means that whoever created or updated this file didn't bother to look for this event in the inheritance chain. It should be true.

@ddbeck
Copy link
Collaborator

ddbeck commented Jul 23, 2020

It looks to me that there was erroneous data in the handwritten table that used to be on MDN and it was ported to browser-compat-data. In the early days, we were less rigorous about checking the data (to complete the migration quickly), so this isn't exactly surprising.

I'd welcome a PR that updates api.HTMLImageElement. You could use true or false values for cases where we you don't know or can't find the exact version; I'd be happy to work with you in a review to refine the data, where possible.

Thank you for reporting this!

@jpmedley
Copy link
Contributor

I think true/false would be fine for Chrome in this instance. Given the length of this inheritance chain, finding the exact version this arrived in Chrome would be extremely difficult.

@Kaiido
Copy link
Contributor

Kaiido commented Aug 5, 2020

Hum... why is it even listed here?

Element/error_event and Window/error_event are the places where this is documented (not sure why it's been split in two pages since both are actually the same, but that's probably for an other issue).

Indeed, the error_event that fires on HTMLImageElement is the global error event.
Just like error_event is not listed in HTMLScriptElement, HTMLIframeElement or any other Interfaces where it may fire, it's not clear why it should be in HTMLImageElement's compat table.

Note that some interfaces like MediaElement or MediaRecorder and probably a lot of other ones do have their own error_event (which are correctly documented).

@jpmedley
Copy link
Contributor

jpmedley commented Aug 5, 2020

Just like error_event is not listed in HTMLScriptElement, HTMLIframeElement or any other Interfaces where it may fire, it's not clear why it should be in HTMLImageElement's compat table.

That may very well be more an indication of a lack of discussion about this issue than evidence of any kind plan or requirement. MDN folks would know more about that.

@jpmedley
Copy link
Contributor

jpmedley commented Aug 5, 2020

Based on what's done in other areas, I'm guessing the solution will be that the MDN page will need to say, "Inherits errors from...".

@queengooborg
Copy link
Contributor

The event data was removed in #13006 in favor of the error event on Element, so this issue is resolved!

@thw0rted
Copy link
Author

@queengooborg do you know how long it's supposed to take for this update to percolate through to the caniuse page?

@queengooborg
Copy link
Contributor

That's a question for @Fyrd, I would say.

@thw0rted
Copy link
Author

I just noticed that the PR you linked merged in October, so I would think that if it fixed the issue (at least for caniuse) it would have showed up by now. Maybe I misunderstand how the data is used?

@Fyrd
Copy link
Contributor

Fyrd commented Apr 14, 2022

The caniuse site is updated every week, but I just discovered that older entries weren't deleted when doing updates. As a result the deletion was basically ignored. Have just fixed that though for future cases. Thanks for bringing that to my attention!

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

No branches or pull requests

7 participants
@ddbeck @Fyrd @thw0rted @queengooborg @Kaiido @jpmedley and others