title: webglcontextrestored event not firing after context lost
body: <p>I'm writing a webgl application and am trying to recover a webgl context after it has been lost, but the context restored event does not seem to be firing.</p>
  
  <p>I'm running the following code, and expecting both "context lost" and "context restored" to be logged, based on the <a href="https://www.khronos.org/registry/webgl/specs/1.0/#5.15.2" rel="nofollow">WebGL specification</a> and the documentation on the <a href="https://www.khronos.org/webgl/wiki/HandlingContextLost" rel="nofollow">WebGL wiki</a>. When I run the code below in jsfiddle in both Chrome (50.0.2661.102 m) and Firefox (46.0.1) I see "context lost" logged but not "context restored", and I'm seeing the same behaviour in my electron application.</p>
  
  <pre><code>var canvas = document.createElement( 'canvas' )
  var gl = canvas.getContext("webgl");
  var WEBGL_lose_context = gl.getExtension('WEBGL_lose_context');
  
  canvas.addEventListener("webglcontextlost", function(e) {
      log("context lost");
      e.preventDefault();
  }, false);
  
  canvas.addEventListener("webglcontextrestored", function() {
      log("context restored");
  }, false);
  
  WEBGL_lose_context.loseContext();
  
  function log(msg) {
    var div = document.createElement("pre");
    div.appendChild(document.createTextNode(msg));
    document.body.appendChild(div);
  }
  </code></pre>
  
  <p>Do I need to do anything extra to get the context restored event to fire? Have I misunderstood the WebGL specification?</p>