-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update Safari support for DOMTokenList API #4628
Conversation
Added info for DOMTokenList methods and properties for Safari Desktop and Mobile. https://developer.apple.com/documentation/webkitjs/domtokenlist
Tested on Mobile Safari 12.1.2
Thanks for your PR! It looks like you have some linter errors with some of the version numbers. In BCD, we use the most simplistic semantic versioning (AKA “5.0” would be “5”). Can you update your PR accordingly? I’ll also be reviewing the changes themselves soon, so I may give an official review too. 😉 |
Done 👌🏻 |
Whoops, I told you a slight fib about the version numbers, haha -- Samsung Internet doesn't follow what I told you. Sorry about that! I went ahead and fixed that up real quick. 😛 I also apologize for the delay on my review. I've found that the SDK versions within the Apple Developer documentation are not the most trustworthy source for Safari versions -- it mentions DOMTokenList is for Safari Desktop 10.0+, yet I've found support in Safari 8.0. |
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.
Alright, so I figured out the story behind DOMTokenList, unfortunately my assumption was correct: Apple's documentation doesn't give us the correct version numbers. I've gone through the API using both SauceLabs and BrowserStack to determine when the API and its members was actually supported. Here's my findings:
DOMTokenList - Safari 6
.replace - Safari 10.1
.supports - Safari 10.1
.length - Safari 6
.value - Safari 10
.item - Safari 6
.contains - Safari 6
.add - Safari 6
.remove - Safari 6
.toggle - Safari 6
.entries - Safari 10.1
.forEach - Safari 10.1
.keys - Safari 10.1
.values - Safari 10.1
May we update the PR accordingly? Thank you for your work on this PR, by the way!
Wow, how much insights. Well, I decided to double-check everything as well, here are my results: DOMTokenList support was added in iOS Safari 5.1 (userAgent: iOS Safari 10: |
Mmm, there is no 6.2 version for some reason, but it really was. Maybe we can add it? Or we can suppose |
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.
Thanks for researching this even more! I'd say that we should set it to 6.1, since the WebKit versions of both are so similar. I don't have access to Safari 5.1 myself, so I'll take your word for it. 😉
(Something that may help reduce confusion: I've found that Safari's user agent string does not specify the correct WebKit version. I've been able to identify what they actually are by comparing their source code within the WebKit repo -- feel free to review browsers/safari.json
to see the real values!)
I have an access to Safari 5.1 thanks to BrowserStack :)
Oh well. It's intriguing. I've found that The real problem is that there were a few versions (sic) of iOS Safari version "10.0". Thus, iOS 10.3 beta with the build number It seems like Apple just forgot to update "Version/10.0" number 🙂. AFAIK we have no possibility to write some note about "Safari 10.0 starting with iOS 10.3", so I can change iOS for |
There's more. I noticed 10.1 and 10.2 versions of iOS Safari in
We can find 10.3(.2,.3) iOS Safari builds in Webkit sources, it's strange, but there are no 10.1 and 10.2 versions there. Now I'm only confused by the iOS Safari's version number in MDN. Is it the number from user agent string ( The first one means we should specify "11", because the next version update (after "10") in the user agent string was only in iOS 11. Even iOS 10.3.4 has "Version/10.0": The second one means we should set the "10.3" version, because iOS 10.3 has the most relevant Webkit engine version 603.1.30 with the |
For Safari iOS, we are using the iOS version as requested by Apple themselves, hence why I said that Safari iOS should be "10.3" when Safari Desktop is 10.1. Regarding the user agent strings...well, to put it into simple terms: they're flat out wrong. Not only do they state the wrong Safari versions, but they even announce incorrect WebKit versions. I came across this discovery while adding the engine versions to the schema -- we thought that user agents were the perfect historical data, and normally they would be, but not in Safari's case...
Since we've only really cared about the major and minor releases of browsers, and iOS 10.1/10.2 were based off of Safari 10.0.x anyways, I feel that we should probably get rid of them at this point. (There's a lot of work described in #2006 for all of this.)
Yes, we should set line 82 to "10.3" as iOS 10.3 released with Safari 10.1. 😉 (I was trying to hint at that in my review comment, but re-reading it, I realize that I didn't do a great job at it. 😝) |
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.
So yeah, we just need to set Safari iOS to 10.3 in line 82 and then we're good to go!
Co-Authored-By: Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>
Well, we've done a good job 👍 I'm only confused with "Changes requested" label on this page, should I do something else for now? |
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.
No need to worry about that "changes requested" flag -- that's just because I've formally requested changes and have not submitted a new review just yet. But now that I'm here, I shall change that and submit formal approval instead!
Thanks for all your hard work on this PR. Let's get this merged in right away! 👍
Updated support for DOMTokenList methods and properties in Safari Desktop and Mobile.