headers/ping attributes should be string, not tokenlist
<!DOCTYPE html>
<script>
document.documentElement.textContent = typeof document.createElement("th").headers;
</script>
Outputs "string" in IE 11 and recent Chrome/Firefox. Spec says it should be "object". Is there any compelling reason that implementations should change, or should the spec change?
@bzbarsky @annevk
Also a.ping/area.ping in Chrome/Firefox (IE 11 seemingly doesn't implement it).
In general the spec tries to move us toward token lists for attributes that are logically token lists. Combined with PutForwards and toString() defined on token lists, this is hoped to be "backward compatible enough".
Maybe we should give up though, if there are no implementations. It does seem doubtful anyone will want to make these changes, given that it has non-negligible back-compat risk with very little upside.
Changing Gecko would be trivial, and I'm happy to do it. The question is if we want to.
Does anyone actually use this attribute for anything? Apart from the reflection bits, I don't see any UA conformance requirements for the headers attribute on table cells/headers. Am I just missing them?
If there are no UA conformance requirements, why would anyone even set this attribute?
Oh, and note that I don't object to trying to make this a tokenlist; I'm just trying to determine the likely compat risks and likely benefits. Currently, my best guess is that the latter is zero and the former is pretty much zero...
headers is for a11y/semantics, at least in theory: https://html.spec.whatwg.org/multipage/#table-descriptions-techniques
I agree that the intersection of people who are using it for these purposes and people who really wish they could use the DOMTokenList interface to do so is probably zero, or in the single digits.
ping seems more likely to be useful and, modulo the compat risks, I think it'd be nice if that were implemented as a DOMTokenList.
Implementation burden for changing headers is close to zero, so if compat risk is also close to zero, I'm in favor of changing it for the sake of being nicer/more consistent/etc.
So, I think we can close this, with the conclusion that we still hope that implementers are willing to move these to DOMTokenLists. Do you guys agree?
This is tested in http://w3c-test.org/html/dom/interfaces.html
https://bugs.chromium.org/p/chromium/issues/detail?id=606724 https://bugs.webkit.org/show_bug.cgi?id=157031 https://bugzilla.mozilla.org/show_bug.cgi?id=1263000 https://bugzilla.mozilla.org/show_bug.cgi?id=1244751 https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7339862/
Please comment or reopen if new information comes up (e.g. if it breaks pages).
Also HTMLElement.dropzone but firstly must be implement as content attr: https://bugzilla.mozilla.org/show_bug.cgi?id=723008 I add small test for all: https://github.com/w3c/web-platform-tests/pull/2932
New info from the Chromium issue:
It has been already done and reverted once ( https://codereview.chromium.org/1416043002). It seems to be breaking some functionality in google.co.in. So is it worth to do this change again now?
So ping is known to cause some breakage.
OK, so with that new info I feel like we should probably change ping to a string, as sad as it is. Does anyone disagree?
Can we get two implementers interested in adding pingList, or should we just give up on a structured DOM API for multiple ping URLs?
I think we should only do it once someone has a real need. Perhaps once we expose a constructor for DOMStringList it might not even be necessary.
What about headers? Switch that back also? (It seems to me use of headers is pretty much always going to be static in markup, and it's a very rarely-needed feature anyway.)
Hi, jumping in the middle (always a bad idea, but...) Headers, I get. Very handy.https://www.w3.org/TR/html-markup/header.html Ping, other than the timeless network testing tool, I'm completely missing; also, not the above www.ws3.org site
The <header> element is not under discussion here. This is about <td headers=""> attribute's corresponding .headers IDL attribute.
The document you linked to says at the top
This document has been discontinued and is only made available for historical purposes.
cheers
I've posted https://github.com/whatwg/html/pull/1262 to move them to USVString/DOMString instead, and give up on the idea that all token-list attributes should be reflected as DOMTokenLists. Ah well!