[whatwg/dom] Future for unique tokens in DOMTokenList (#201)

Per DOM tokens in DOMTokenList should be unique, which is provided by "ordered set parser
" algo (https://dom.spec.whatwg.org/#concept-ordered-set-parser)
But after long time already beyond this is not implemented by any engine, or mabye I wrong so please correct me (Edge, Webkit or Servo do this?).
Some bugs from Mozilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=869788
https://bugzilla.mozilla.org/show_bug.cgi?id=910121

Repeated tokens cause that other definition around DOMTokenList are not valid, for example invoking `add()` should run the "update steps" (what means set associated attr to new value taken from ordered set serializer for tokens, so this attr's value should have unique tokens too). But browsers don't do this and we get repeated tokens.
```
<script>

 var el = document.createElement("div");
 
 el.className = " a a b ";
 console.log(el.className.length); // 7
 console.log(el.classList.length); // 3
 console.log(Array.prototype.slice.call(el.classList).join(" ")); // a a b
 
 el.classList.add("a"); // should remove duplicate and white space in associated attr value
 
 console.log(el.className.length); // 7
 console.log(el.classList.length); // 3
 console.log(Array.prototype.slice.call(el.classList).join(" ")); // a a b
 
 el.classList.remove("a");
 
 console.log(el.className.length); // 1 (Gecko and Presto return 2, we have "b ")
 console.log(el.classList.length); // 1
 console.log(Array.prototype.slice.call(el.classList).join(" ")); // b

</script>
```
Unique tokens in DOMTokenList still are considered as something attainable in the near future? 

---
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/201

Received on Thursday, 31 March 2016 20:07:53 UTC