-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-128627: Fix iPad detection in wasm-gc #135388
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
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
While we're at it maybe let's add links to the relevant webkit issue and the fix: |
Otherwise looks good to me. Thanks @ryanking13! |
Maybe we should also add a comment saying this code is only needed to make jspi work and since jspi is not yet supported on Safari it would be okay to turn it off for desktop Safari as well if we need to. |
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!
// Starting with iPadOS 13, iPads might send a platform string that looks like a desktop Mac. | ||
// To differentiate, we check if the platform is 'MacIntel' (common for Macs and newer iPads) | ||
// AND if the device has multi-touch capabilities (navigator.maxTouchPoints > 1) | ||
(navigator.platform === 'MacIntel' && typeof navigator.maxTouchPoints !== 'undefined' && navigator.maxTouchPoints > 1) |
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.
duplicated same-comment here: pyodide/pyodide#5695 (review)
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.
Added in a reference to the radar and CPython issues, but otherwise, LGTM.
Thanks @ryanking13 for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection to add a feature-based check to detect this case. (cherry picked from commit d447129) Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
GH-135419 is a backport of this pull request to the 3.14 branch. |
On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection to add a feature-based check to detect this case. (cherry picked from commit d447129) Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
|
Buildbot failure is a false positive. |
As of iOS / iPadOS 18.3.1, enabling wasm-gc is making the interpreter fail to load.
This issue was handled by @ambv in #130418, but that fix had an issue with not detecting the iPad correctly.
In iPad + Safari, iPad behaves like a Mac and checking
iPad
string innavigator.platform
fails to detect iPad.Confirmed on device + downstream PR (pyodide/pyodide#5695)
cc: @hoodmane @WebReflection