[whatwg/dom] <span class="a b c">.classList.replace("c", "a") -> "a b" or "b a"? (DOMTokenList) (#442)

Also filed as w3c/dom#117 because I got confused with the two specs.  :(

The spec just says "Replace token in tokens with newToken", but this doesn't actually work in an ordered set, because if you actually replaced it as instructed, the set would have a duplicate entry.  Test-case:

```html
data:text/html,<!doctype html>
<script>
var span = document.createElement("span");
span.setAttribute("class", "a b c");
span.classList.replace("c", "a");
document.documentElement.textContent = span.getAttribute("class");
</script>
```

Firefox Aurora says "a b".  Chrome doesn't seem to support .replace().  I don't have Edge or WebKit handy yet to test.  In the W3C issue someone reported that WebKit is the same as Firefox.

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

Received on Tuesday, 18 April 2017 11:41:41 UTC