<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>264683</bug_id>
          
          <creation_ts>2023-11-11 12:29:53 -0800</creation_ts>
          <short_desc>&quot;context lost&quot; when getting WebGL context</short_desc>
          <delta_ts>2023-11-11 14:31:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebGL</component>
          <version>Safari 17</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 17</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>264684</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andre-John Mas">andrejohn.mas</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>dino</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1991878</commentid>
    <comment_count>0</comment_count>
    <who name="Andre-John Mas">andrejohn.mas</who>
    <bug_when>2023-11-11 12:29:53 -0800</bug_when>
    <thetext>We are no longer able to get the WebGL context on iOS or iPadOS using release 17, with a &quot;context lost&quot; error being logged.

The issues was discovered using Three.JS, but further investigation reveals this impacts all WebGL applications (those I have tested with).

The following code is enough to cause the issue:

```
  function initWebGL () {
	const canvas = document.querySelector(&apos;#canvas&apos;);
	canvas.width = window.innerWidth;
	canvas.height = window.innerHeight;

	const glOptions = {
	  // antialias: false,
	  // alpha: false,
	  // premultipliedAlpha: false
	};

	const gl = canvas.getContext(&apos;webgl2&apos;, glOptions)
	  || canvas.getContext(&apos;webgl&apos;, glOptions)
	  || canvas.getContext(&apos;experimental-webgl&apos;, glOptions);
  }

  initWebGL();
```

Note, this does not impact Safari (17.0 (19616.1.27.211.1)) on MacOS X 14.

Tested with: iOS 17.0.3, iPadOS 17.0.3 and MacOSX 14 (Safari).

Note, discussion in the Three.JS forum: https://discourse.threejs.org/t/three-js-broken-on-ios-17-with-context-lost/58025</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1991906</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-11 14:31:53 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 264684 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>