Bug 249196

Summary: If the WebGL option is turned off, executing the WebGL code will crash the entire page.
Product: WebKit Reporter: limichange <limichange>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, dino, djg, kbr, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
Attachments:
Description Flags
Reproduce the steps none

Description limichange 2022-12-12 17:39:17 PST
# Description
when one turn off the `WebGL via Metal` option, the canvas crashes the entire page. 
The page just displays `A problem repeatedly occurred with "https://get.webgl.org"`.
I tested a lot of other sites that behaved the same way.
Wouldn't it be better to throw a JS error for the developer to deal with?

## Test site
https://get.webgl.org
https://threejs.org/examples/#webgl_animation_keyframes
https://pixijs.com
Comment 1 Alexey Proskuryakov 2022-12-14 12:02:13 PST
Turning off WebGL via Metal means that the old OpenGL based implementation is used.

It's expected to be buggy (that's why it's obsolete and not used by default), but I don't think that crashing on every WebGL page is expected.

What hardware, macOS version and Safari version are you seeing this with?
Comment 2 limichange 2022-12-14 18:08:53 PST
Thank you for your response.

Below is the specific information needed, and I will upload a video about the bug.

## Env

### Safari

Version 16.2 (18614.3.7.1.5)

SourceVersion 7614003007001005

### MacOS

                    'c.          limichange@limichanges-Mac-Studio.local
                 ,xNMM.          ---------------------------------------
               .OMMMMo           OS: macOS 13.1 22C65 arm64
               OMMM0,            Host: Mac13,1
     .;loddo:' loolloddol;.      Kernel: 22.2.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 13 hours, 50 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 152 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 2560x1440
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Light)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: Monaco 14
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1 Max
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1 Max
       .cooc,.    .,coo:.        Memory: 5000MiB / 32768MiB
Comment 3 limichange 2022-12-14 18:17:39 PST
Created attachment 464051 [details]
Reproduce the steps
Comment 4 Radar WebKit Bug Importer 2022-12-14 19:11:25 PST
<rdar://problem/103383754>
Comment 5 Kimmo Kinnunen 2022-12-15 00:10:23 PST
Thank you for the report.
Is there a specific reason you turn off "WebGL via Metal"?

This is a WebKit / Safari internal option. This is not user-facing configuration toggle and users are not intended to modify it.

The crash is intentional and due to sandboxing.
Comment 6 limichange 2022-12-15 00:51:42 PST
Sure, this is not user-facing configuration toggle.

Since there are options, it is more or less likely to be touched by mistake.

Anyway, it's not a good behavior to crash the whole page.