Re: [whatwg/dom] Clarify that DOMTokenList's .replace() must preserve the original order (#324)

But it's not clear now? The same story was for `setAttributeNode` https://github.com/whatwg/dom/issues/116 and any additional prose was not added. Replace is replace, maybe adding would be more unclear, but replace?
@ayg Btw, after fixing https://bugzilla.mozilla.org/show_bug.cgi?id=1293563 looks like Gecko (actual Nightly) retains the correct order or am I wrong?
`
<script>
 function showTokens(set){
  return Array.prototype.slice.call(set).join(" ");
 }
 var html = document.createElement("html");
 html.className = " a b c d ";
 console.log(showTokens(html.classList)); // "a b c d"
 console.log(html.className); // " a b c d "
 html.classList.replace("b", "e"); 
 console.log(showTokens(html.classList)); // "a e c d"
 console.log(html.className); // "a e c d"
 
 html.className = "a b a c";
 html.classList.replace("a", "d");
 console.log(showTokens(html.classList)); // "d b c"
 console.log(html.className); // "d b c"
</script>
`

-- 
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/324#issuecomment-244146425

Received on Thursday, 1 September 2016 17:11:10 UTC