Re: [whatwg/dom] DOMTokenList shouldn't add empty attributes (#488)

This check isn't just for web compat, it's also common sense.  We shouldn't add an empty attribute when there previously wasn't any attribute -- what's the point?  You could even argue that if the last token in the list was removed, you should remove the attribute, although I don't advocate going that far.

The checks in 03657b3 are still needed for when `toggle` force-removes a token that's not present but there are other tokens.  This check is still needed for when `remove` is used, because that does run the update steps when removing a token that's already not present.  In principle this check could be in `remove` instead of the update steps, because that's the only case where it will be hit, but it's logically more appropriate here, and more robust in the event that we add other ways to alter DOMTokenLists in the future.

So I think this can be taken now as-is with no additional changes.

-- 
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/pull/488#issuecomment-320988471

Received on Tuesday, 8 August 2017 15:17:41 UTC