Browser-compat-data: api.Element.name entry doesn't make sense as used on MDN

Created on 14 Sep 2020  ·  7Comments  ·  Source: mdn/browser-compat-data

https://developer.mozilla.org/en-US/docs/Web/API/Element/name says:

name gets or sets the name property of an element in the DOM. It only applies to the following elements: <a>, <applet>, <button>, <form>, <frame>, <iframe>, <img>, <input>, <map>, <meta>, <object>, <param>, <select>, and <textarea>.

Note: The name property doesn't exist for other elements; unlike tagName and nodeName, it is not a property of the Node, Element or HTMLElement interfaces.

https://developer.mozilla.org/en-US/docs/Web/API/Element/name#Browser_compatibility however is not a useful table for this page, because BCD correctly reflects that there's no name attribute on Element in any browser.

@ddbeck how should one handle a case like this? Should the MDN page instead link to the tables for the elements that do support it?

data

All 7 comments

Yeah, this is super weird. There isn't an Element.name attribute, but there is an HTMLFormElement.name and HTMLImageElement.name and so on.

And looking at the history of the page, @sideshowbarker's comment on the most recent edit is probably right:

The Element interface actually has no 'name' attribute (this entire article should be deleted…)

My hunch is that we should make a brief check to make sure there was no historic Element.name (e.g., that some previous DOM spec doesn't contain that attribute).

If it did exist, then we could slap a deprecation notice on the page and refer people to the list of individual HTML*Element.name pages (example).

If not, then we could archive the page and drop the Element.name data from BCD.

Thanks for checking that, @saschanaz.

My earlier suggestion was slightly incomplete. Here are the steps to fix this:

  • [x] Archive Element.name page
  • [ ] Drop the feature api.Element.name as irrelevant
  • [ ] Add features for the real api.HTML*Element.name attributes

Thanks @ddbeck, that sounds great! Will you check back here when the page has been archived? I can try to do points 2 and 3 from your list.

@foolip Yes, I'll update this issue as soon as I've archived the page. 👍

@foolip OK, on the advice of @chrisdavidmills, I redirected the page to https://developer.mozilla.org/en-US/docs/Web/API (instead of archiving or deleting). We're now good to drop api.Element.name from BCD

I've sent https://github.com/mdn/browser-compat-data/pull/6751 to remove the api.Element.name as irrelevant.

Here are the 17 HTML element interfaces that have name attributes in the HTML spec's IDL:

  • [ ] [HTMLAnchorElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement#Browser_compatibility)
  • [ ] [HTMLButtonElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement#Browser_compatibility)
  • [ ] [HTMLEmbedElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement#Browser_compatibility)
  • [ ] [HTMLFieldSetElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement#Browser_compatibility)
  • [ ] [HTMLFormElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement#Browser_compatibility)
  • [ ] [HTMLFrameElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement#Browser_compatibility)
  • [ ] [HTMLIFrameElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement#Browser_compatibility)
  • [ ] [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement#Browser_compatibility)
  • [ ] [HTMLInputElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Browser_compatibility)
  • [ ] [HTMLMapElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMapElement#Browser_compatibility)
  • [ ] [HTMLMetaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement#Browser_compatibility)
  • [ ] [HTMLObjectElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement#Browser_compatibility)
  • [ ] [HTMLOutputElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOutputElement#Browser_compatibility)
  • [ ] [HTMLParamElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParamElement#Browser_compatibility)
  • [ ] [HTMLSelectElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement#Browser_compatibility)
  • [ ] [HTMLSlotElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement#Browser_compatibility)
  • [ ] [HTMLTextAreaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#Browser_compatibility)

The name entry exists on most but not all of these, and there are other consistency problems to work through, like whether they should be marked deprecated or not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RobPethick picture RobPethick  ·  3Comments

ddbeck picture ddbeck  ·  3Comments

here-nerd picture here-nerd  ·  3Comments

ghost picture ghost  ·  3Comments

bershanskiy picture bershanskiy  ·  3Comments