Skip to content
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

Manually map Safari versions in getMatchingBrowserVersion #16594

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

foolip
Copy link
Contributor

@foolip foolip commented Jun 8, 2022

This is not ideal, but it fixes the problem now. Tests are in place to
ensure that if we fix it in some other way, there's no observable
difference.

@github-actions github-actions bot added the scripts Issues or pull requests regarding the scripts in scripts/. label Jun 8, 2022
@foolip foolip requested a review from queengooborg June 8, 2022 07:28
@github-actions
Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the rest of the iOS/macOS mirroring is okay, actually, despite what I said earlier offline. In all other cases, we seem to be okay.

scripts/release/mirror.js Outdated Show resolved Hide resolved
@foolip
Copy link
Contributor Author

foolip commented Jul 8, 2022

I've compared build/data.json before and after these changes and it looks like the only changes are 8→7 and 15.1→15.

I don't think the 15.1→15 changes are worth reviewing at all, since that's just a bug. I'll make a list of the paths with 8→7 changes.

This will also allow the mirror migration script to replace a lot more data.

@foolip
Copy link
Contributor Author

foolip commented Jul 8, 2022

I hacked up npm run diff to produce this:

api.Element.matches:
 → support.safari_ios.0.version_added is edited ("8" → "7")
api.HTMLMediaElement.audioTracks:
 → support.safari_ios.version_added is edited ("8" → "7")
api.HTMLMediaElement.videoTracks:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.advance:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.continue:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.delete:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.direction:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.key:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.primaryKey:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.source:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursor.update:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursorWithValue:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBCursorWithValue.value:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.close:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.createObjectStore:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.deleteObjectStore:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.name:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.objectStoreNames:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.transaction:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.version:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBDatabase.versionchange_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBFactory:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBFactory.cmp:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBFactory.deleteDatabase:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBFactory.open:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.count:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.get:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.getKey:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.keyPath:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.multiEntry:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.name:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.objectStore:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.openCursor:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.openKeyCursor:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBIndex.unique:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.bound:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.lower:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.lowerBound:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.lowerOpen:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.only:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.upper:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.upperBound:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBKeyRange.upperOpen:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.add:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.autoIncrement:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.clear:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.count:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.createIndex:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.delete:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.deleteIndex:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.get:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.index:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.indexNames:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.keyPath:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.name:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.openCursor:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.openKeyCursor:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.put:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBObjectStore.transaction:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBOpenDBRequest:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBOpenDBRequest.blocked_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBOpenDBRequest.upgradeneeded_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.error:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.error_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.readyState:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.result:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.source:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.success_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBRequest.transaction:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.abort:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.abort_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.complete_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.db:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.error:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.error_event:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.mode:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBTransaction.objectStore:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBVersionChangeEvent:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBVersionChangeEvent.newVersion:
 → support.safari_ios.version_added is edited ("8" → "7")
api.IDBVersionChangeEvent.oldVersion:
 → support.safari_ios.version_added is edited ("8" → "7")
api.PerformanceNavigationTiming:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.domComplete:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.domContentLoadedEventEnd:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.domContentLoadedEventStart:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.domInteractive:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.loadEventEnd:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.loadEventStart:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.redirectCount:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.toJSON:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.type:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.unloadEventEnd:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.PerformanceNavigationTiming.unloadEventStart:
 → support.safari_ios.version_added is edited ("15.1" → "15")
api.TextTrackList.getTrackById:
 → support.safari_ios.version_added is edited ("8" → "7")
api.indexedDB:
 → support.safari_ios.version_added is edited ("8" → "7")
css.properties.background-repeat.round_space:
 → support.safari_ios.version_added is edited ("8" → "7")
html.elements.source.sizes:
 → support.safari_ios.1.version_added is edited ("8" → "7")
html.elements.source.srcset:
 → support.safari_ios.1.version_added is edited ("8" → "7")

@foolip
Copy link
Contributor Author

foolip commented Jul 8, 2022

These 8→7 changes seemed worth reviewing / testing on iOS 7/8 on BrowserStack:

Then there's indexedDB and IDB*. https://caniuse.com/indexeddb has different versions. https://mdn-bcd-collector.appspot.com/tests/api/indexedDB tests true in iOS 8 but false in 7. https://en.wikipedia.org/wiki/Indexed_Database_API#cite_note-10 supports 8 as the right version, but Safari 7.1 on macOS on BrowserStack also tests true. But the correct iOS version is still 8, not 7.

@foolip
Copy link
Contributor Author

foolip commented Jul 8, 2022

#16879 updates the IndexedDB data.

foolip added a commit to foolip/browser-compat-data that referenced this pull request Jul 8, 2022
It was implemented here:
WebKit/WebKit@b195c16
https://github.com/WebKit/WebKit/blob/b195c162a9805acacbb7d32328ba6fbbc1df4453/Source/WebCore/Configurations/Version.xcconfig

WebKit trunk version 538.8.0 maps to Safari 8 on both macOS and iOS.

Confirmed with tested in iOS 7 and 8:
mdn#16594 (comment)

This was last updated based on the collector here:
mdn#7929

But that was based on results from Safari 7.1:
foolip/mdn-bcd-results@5067a4d
@foolip
Copy link
Contributor Author

foolip commented Jul 8, 2022

#16880 fixes getTrackById.

@gsnedders
Copy link
Contributor

I don't think the 15.1→15 changes are worth reviewing at all, since that's just a bug.

They're probably worth reviewing?

@gsnedders
Copy link
Contributor

gsnedders commented Jul 8, 2022

api.PerformanceNavigationTiming:
 → support.safari_ios.version_added is edited ("15.1" → "15")

I… think this is wrong? I think it should be 15.1 for both macOS and iOS, but I haven't tested them recently.

@gsnedders
Copy link
Contributor

api.PerformanceNavigationTiming:
 → support.safari_ios.version_added is edited ("15.1" → "15")

I… think this is wrong? I think it should be 15.1 for both macOS and iOS, but I haven't tested them recently.

Ah, no: WebKit/WebKit@988a6bd is the commit that enabled it, and as the tags indicate that was in Safari 15.0 for macOS, but only Safari 15.1 for iOS.

Turns out I should just trust the changes I made a while back: #13142 ;P

queengooborg pushed a commit that referenced this pull request Jul 9, 2022
It was implemented here:
WebKit/WebKit@b195c16
https://github.com/WebKit/WebKit/blob/b195c162a9805acacbb7d32328ba6fbbc1df4453/Source/WebCore/Configurations/Version.xcconfig

WebKit trunk version 538.8.0 maps to Safari 8 on both macOS and iOS.

Confirmed with tested in iOS 7 and 8:
#16594 (comment)

This was last updated based on the collector here:
#7929

But that was based on results from Safari 7.1:
foolip/mdn-bcd-results@5067a4d
@foolip
Copy link
Contributor Author

foolip commented Jul 9, 2022

I don't think the 15.1→15 changes are worth reviewing at all, since that's just a bug.

They're probably worth reviewing?

My reasoning was that any 15+15.1 pairs that we have are very likely just due to the mirroring script bug. Off-by-one versions further in the past will have been explicitly entered like this and reviewed at some point, making it more likely they're actually correct.

@foolip
Copy link
Contributor Author

foolip commented Jul 9, 2022

@gsnedders sounds like at least one case of 15+15.1 is correct then?

Maybe what we should do is check which such pairs existed before the mirroring migrations.

@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

I've run comm -12 <(npm run traverse -- -b safari -f 15) <(npm run traverse -- -b safari_ios -f 15.1) at commit f11324f (before da52849) and these are the APIs that had 15+15.1 pairs:

api.PerformanceNavigationTiming
api.PerformanceNavigationTiming.domComplete
api.PerformanceNavigationTiming.domContentLoadedEventEnd
api.PerformanceNavigationTiming.domContentLoadedEventStart
api.PerformanceNavigationTiming.domInteractive
api.PerformanceNavigationTiming.loadEventEnd
api.PerformanceNavigationTiming.loadEventStart
api.PerformanceNavigationTiming.redirectCount
api.PerformanceNavigationTiming.toJSON
api.PerformanceNavigationTiming.type
api.PerformanceNavigationTiming.unloadEventEnd
api.PerformanceNavigationTiming.unloadEventStart

@gsnedders confirmed these are correct per #13142.

This is not ideal, but it fixes the problem now. Tests are in place to
ensure that if we fix it in some other way, there's no observable
difference.
@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

The remaining changes that will result from this are now:

api.Element.matches:
 → support.safari_ios.0.version_added is edited ("8" → "7")
api.HTMLMediaElement.audioTracks:
 → support.safari_ios.version_added is edited ("8" → "7")
api.HTMLMediaElement.videoTracks:
 → support.safari_ios.version_added is edited ("8" → "7")
css.properties.background-repeat.round_space:
 → support.safari_ios.version_added is edited ("8" → "7")
html.elements.source.sizes:
 → support.safari_ios.1.version_added is edited ("8" → "7")
html.elements.source.srcset:
 → support.safari_ios.1.version_added is edited ("8" → "7")

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jul 13, 2022
@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

I've sent #16959 to fix the api.Element.matches case.

@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

#16960 is to update css.properties.background-repeat.round_space

@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

Alright, sizes and srcset fixed in #16961, that's the last of it!

@foolip
Copy link
Contributor Author

foolip commented Jul 13, 2022

Alright, the only remaining changes now are correct:

api.HTMLMediaElement.audioTracks:
 → support.safari_ios.version_added is edited ("8" → "7")
api.HTMLMediaElement.videoTracks:
 → support.safari_ios.version_added is edited ("8" → "7")

Copy link
Contributor

@queengooborg queengooborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a fan of the idea of placing this mapping in a script vs. the browser data, but it at least solves the problem right away. I'll follow up to move this into the browser JSON!

@queengooborg queengooborg merged commit 734b667 into main Jul 14, 2022
@queengooborg queengooborg deleted the mirror-fixes branch July 14, 2022 14:08
foolip added a commit to foolip/browser-compat-data that referenced this pull request Jul 14, 2022
After mdn#16594 a lot more
Safari data can be mirrored. Note that this just ran the script and also
includes a small amount of non-Safari changes.
queengooborg pushed a commit that referenced this pull request Jul 14, 2022
After #16594 a lot more
Safari data can be mirrored. Note that this just ran the script and also
includes a small amount of non-Safari changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API scripts Issues or pull requests regarding the scripts in scripts/.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants