| Summary: | REGRESSION (iPadOS 17 Developer Beta 8): "WebGL: context lost." error when backgrounding Safari | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jason Hafer <haferje> | ||||
| Component: | WebGL | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED DUPLICATE | ||||||
| Severity: | Blocker | CC: | 41802399, airfoil.loppers0y, ap, canymebee, dino, karlcow, kbr, kkinnunen, lphuabin, opher, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | BrowserCompat, InRadar | ||||
| Version: | Safari 17 | ||||||
| Hardware: | iPhone / iPad | ||||||
| OS: | Other | ||||||
| Attachments: |
|
||||||
|
Description
Jason Hafer
2023-09-08 06:53:17 PDT
We are experiencing the exact same regression issue at eko (where WebGL is used for video post-processing). To reproduce: Visit this URL in Safari: https://play.eko.com/page?id=FaGixErosH Minimize Safari or lock the phone with the power button. Then unlock the phone - WebGL has stopped, and will not work again on any page (eko or otherwise) with "WebGL: context lost". Video demo here: https://drive.google.com/file/d/17Kini4xI-eEg6fOYUpkMfonnIntCepYc/view?usp=sharing Whoops wrong url - Here is the video demo: https://drive.google.com/file/d/1ZcVtcxp3RXquWLToCDfPaYb7XaN-xGdg/view?usp=sharing We are seeing the same issue with Cocos Creator engine, including content in safari web page and content in WKWebView managed by WeChat. Testing environment: - iPhone 12 - iOS 16.7 (Lower version is ok) Testing with our local test case, but it's quite universal, we are testing public pages now Created attachment 467845 [details]
error breakpoint
The error breakpoint inside WeChat WKWebView is in the screenshot, it indicates `b` from `gl.createShader` is null which is actually due to Context Lost.
We double checked with `ctx.isContextLost()`, it returns true.
Actual behavior in iOS 16.7 Safari - Opened several webgl site and games, played a little while - Lock screen - Unlock screen (The following screen recording is after unlocking) https://drive.google.com/file/d/1HwSeWnSD0_MnuxrkMR_LoCI0Jgis5HIz/view?usp=sharing We also encountered this issue on Alipay, with iOS version 16.7 and above. A typical reproduction path is repeatedly entering and exiting a page that uses WebGL. The error message displayed is "WebGL: context lost" or "Error: WebGL unsupported in this browser". In our case after much effort we've been able to narrow this down to a texImage2D call that receives a video element as its 6th argument. If the video is paused, then the WebGl crash happens (and WebGL will no longer be able to get context). If the video is playing, the crash does not happen.
e.g.
texImage2D(
bindPoint,
0,
gl.RGBA,
gl.RGBA,
gl.UNSIGNED_BYTE,
videoElement
);
Our temporary workaround is to check whether the video was playing or not in iOS 17
*** This bug has been marked as a duplicate of bug 261313 *** (In reply to Alexey Proskuryakov from comment #9) > > *** This bug has been marked as a duplicate of bug 261313 *** Will this fix be merged into later versions of iOS 16? We‘ve seen that the frequency of occurrence in iOS 16.7 is 20 times that of iOS 17. Do we know when this fix is going in? Is it going to be applied to 17.1? We are still seeing the same issue in the 17.1 Beta release. Please let us know if this still reproduces in iOS 17.1 Beta 2.
> Will this fix be merged into later versions of iOS 16? We‘ve seen that the frequency of occurrence in iOS 16.7 is 20 times that of iOS 17.
Let me bring this up for discussion.
We also encountered problems in iOS 16.7. If 17.1 can be fixed, whether there will be a fixed version in iOS 16. After all, there are still many users stuck on this version. |