This repository has been archived by the owner on Nov 11, 2019. It is now read-only.
forked from whatwg/dom
-
Notifications
You must be signed in to change notification settings - Fork 18
<span class="a b c">.classList.replace("c", "a") -> "a b" or "b a"? #117
Milestone
Comments
I tested with Safari 10.1, it say "a b" too, same as FireFox. |
thanks, @linzhiping . I think we'll add it in DOM4.1. @chaals @linzhiping will take over this issue. |
yongsheng
pushed a commit
to yongsheng/dom
that referenced
this issue
May 17, 2017
Changes in Terminology. Add a definition to "ordered set" and clarify the replace operation to make sure the behavior is clear.
yongsheng
pushed a commit
to yongsheng/dom
that referenced
this issue
May 17, 2017
1. Define token set using ordered set for DOMTokenList. 2. Refine DOMTokenList's length and indexing. 3. Make DOMTokenList's contains() not throw because it doesn't modify token set. 4. Combine DOMSettableTokenList into DOMTokenList, because DOMTokenList.value could be a stringifier attribute, therefore it is OK to make 'value' a stringifier. 5. Use less loops for DOMTokenList's add() and remove(). 6. Always update a DOMTokenList when invoking toggle(). This shall normalize duplicates and whitespaces even if they're no-ops like add()/remove(). This fixes w3c#118 too. 7. Introduce DOMTokenList's replace(). This shall fix w3c#117 together. 8. Introduce DOMTokenList's supports().
yongsheng
pushed a commit
that referenced
this issue
May 17, 2017
Changes in Terminology. Add a definition to "ordered set" and clarify the replace operation to make sure the behavior is clear.
yongsheng
pushed a commit
that referenced
this issue
May 17, 2017
1. Define token set using ordered set for DOMTokenList. 2. Refine DOMTokenList's length and indexing. 3. Make DOMTokenList's contains() not throw because it doesn't modify token set. 4. Combine DOMSettableTokenList into DOMTokenList, because DOMTokenList.value could be a stringifier attribute, therefore it is OK to make 'value' a stringifier. 5. Use less loops for DOMTokenList's add() and remove(). 6. Always update a DOMTokenList when invoking toggle(). This shall normalize duplicates and whitespaces even if they're no-ops like add()/remove(). This fixes #118 too. 7. Introduce DOMTokenList's replace(). This shall fix #117 together. 8. Introduce DOMTokenList's supports().
This shall be fixed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
Firefox Aurora says "a b". Chrome doesn't seem to support .replace(). I don't have Edge or WebKit handy yet to test.
The text was updated successfully, but these errors were encountered: