-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOMTokenList: separate whitespace trim/duplicate removal; add versions #6691
DOMTokenList: separate whitespace trim/duplicate removal; add versions #6691
Conversation
This will remove an entry, so adding the needs-release-note label. |
@vinyldarkscratch can you link to the tests you used for this? |
Certainly! I used the following pieces of JavaScript to test manually in BrowserStack:
var elm = document.createElement('b');
elm.className = ' foo bar foo ';
elm.classList.remove('bar');
console.log(elm.className === 'foo foo' || elm.className === 'foo');
var elm = document.createElement('b');
elm.className = ' foo bar foo ';
elm.classList.remove('bar');
console.log(return elm.className === 'foo'); |
@vinyldarkscratch the |
I checked all the browser versions, and have confirmed that white space trimming came first or at the same time in all the browsers, and that duplicate removal had come later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the review of the data to Philip, but I had a couple nitpicky style suggestions. Thank you!
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
In
DOMTokenList
, we have an entry about how modifications will trim the whitespace and remove duplicates, with partial implementation notes for IE and Edge about how they trim whitespace but not remove duplicates. However, from my testing, I've found that Chrome and Firefox also implemented whitespace trimming before duplicate removal. This PR separates the subfeature into two subfeatures, and adds/fixes versions for both of them.