mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	[3.14] gh-128627: Fix iPad detection in wasm-gc (GH-135388) (#135419)
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 d447129758)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									4a30154fd2
								
							
						
					
					
						commit
						e76dbc87a2
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		|  | @ -71,7 +71,16 @@ EM_JS(CountArgsFunc, _PyEM_GetCountArgsPtr, (), { | |||
| // )
 | ||||
| 
 | ||||
| function getPyEMCountArgsPtr() { | ||||
|     let isIOS = globalThis.navigator && /iPad|iPhone|iPod/.test(navigator.platform); | ||||
|     // Starting with iOS 18.3.1, WebKit on iOS has an issue with the garbage
 | ||||
|     // collector that breaks the call trampoline. See #130418 and
 | ||||
|     // https://bugs.webkit.org/show_bug.cgi?id=293113 for details.
 | ||||
|     let isIOS = globalThis.navigator && ( | ||||
|         /iPad|iPhone|iPod/.test(navigator.userAgent) || | ||||
|         // 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) | ||||
|     ) | ||||
|     if (isIOS) { | ||||
|         return 0; | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)