Skip to content

Commit

Permalink
Return boolean from DOMTokenList.replace()
Browse files Browse the repository at this point in the history
Spec change in whatwg/dom#582
Test added in web-platform-tests/wpt#9920
  • Loading branch information
Zirro authored and domenic committed Apr 1, 2018
1 parent 8ad6b17 commit 7f41ae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/jsdom/living/nodes/DOMTokenList-impl.js
Expand Up @@ -144,10 +144,11 @@ class DOMTokenListImpl {
validateTokens(token, newToken);
this._syncWithElement();
if (!this._tokenSet.contains(token)) {
return;
return false;
}
this._tokenSet.replace(token, newToken);
this._updateSteps();
return true;
}

supports(token) {
Expand Down
2 changes: 1 addition & 1 deletion lib/jsdom/living/nodes/DOMTokenList.webidl
Expand Up @@ -6,7 +6,7 @@ interface DOMTokenList {
[CEReactions] void add(DOMString... tokens);
[CEReactions] void remove(DOMString... tokens);
[CEReactions] boolean toggle(DOMString token, optional boolean force);
[CEReactions] void replace(DOMString token, DOMString newToken);
[CEReactions] boolean replace(DOMString token, DOMString newToken);
boolean supports(DOMString token);
[CEReactions] stringifier attribute DOMString value;
iterable<DOMString>;
Expand Down

0 comments on commit 7f41ae5

Please sign in to comment.