Re: [whatwg/dom] Spec for DOMTokenList stringifier disagrees with every single implementation (#105)

@ayg But some normalization is done for that method, `remove("a")` for `" a a b b "` will remove all `"a"` and trim space (at least in the Edge / Chrome). In other site, invoking `add(a)` for `" b b b "` will return `" b b  a"` (retains all spaces). I don't check all methods, but  it would be convenient to have a consistent behavior for all of them, especially when Safari 10 land this normalization (removing duplicates and trim spaces) without any compatibility reports. And, per the current spec, we can normalize the content attribute by invoking `add()` or `remove()` without any argument.

Current definitions in spec seem most sense because:
Stringifire `DOMTokenList` is the same ass getter `DOMTokenList.value`.
Setter for attribute which operates on DOMTokenList (like 'Element.classList = ') is the same ass setter `DOMTokenList.value` and is the same ass setter `Element.className`, so we can stop using `className`.
Would be stragne changing only stringifire but not setter (if you still consider this change).

But it still does not matter if finally sets will not contain duplicates (https://github.com/whatwg/dom/issues/201) because it comes directly from the [definition](https://dom.spec.whatwg.org/#ordered%20sets).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/105#issuecomment-242529351

Received on Thursday, 25 August 2016 20:34:22 UTC