[whatwg/dom] Change DOMTokenList's replace() to return boolean (#582)

This specifies a return value for DOMTokenList's `replace(token, newToken)` method, making it return true if token was replaced by newToken and false otherwise. This is useful for code which takes different paths depending on whether a replacement occurred, avoiding the need for an extra condition using `contains()`.

I have modified the [Element-classlist.html](https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/Element-classlist.html) test to include [testing](https://gist.github.com/Zirro/b0fb873ccb86eb3bb6596833558abca4#file-element-classlist-html-L406) of this change, and will submit a pull request to the WPT repository if it is approved here.

Fixes #577.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/582

-- Commit Summary --

  * Change DOMTokenList's replace() to return boolean

-- File Changes --

    M dom.bs (8)

-- Patch Links --

https://github.com/whatwg/dom/pull/582.patch
https://github.com/whatwg/dom/pull/582.diff

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

Received on Sunday, 4 March 2018 15:11:38 UTC