Web Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 17:29:26 +0000 (17:29 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 17:29:26 +0000 (17:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196874
<rdar://problem/49858912>

Reviewed by Timothy Hatcher.

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.createContext):

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.prototype.process.getContent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Recording.js
Source/WebInspectorUI/UserInterface/Models/RecordingAction.js

index 663d007..be41c75 100644 (file)
@@ -1,5 +1,19 @@
 2019-04-15  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
+        https://bugs.webkit.org/show_bug.cgi?id=196874
+        <rdar://problem/49858912>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/Recording.js:
+        (WI.Recording.prototype.createContext):
+
+        * UserInterface/Models/RecordingAction.js:
+        (WI.RecordingAction.prototype.process.getContent):
+
+2019-04-15  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: sidebar panels shouldn't be added as subviews unless visible
         https://bugs.webkit.org/show_bug.cgi?id=196888
         <rdar://problem/49870659>
index 0493081..467f42d 100644 (file)
@@ -451,7 +451,7 @@ WI.Recording = class Recording extends WI.Object
         if (this._type === WI.Recording.Type.Canvas2D)
             return createCanvasContext("2d");
 
-        if (this._type === WI.Recording.Type.BitmapRenderer)
+        if (this._type === WI.Recording.Type.CanvasBitmapRenderer)
             return createCanvasContext("bitmaprenderer");
 
         if (this._type === WI.Recording.Type.CanvasWebGL)
index 508b9cc..cfb26c6 100644 (file)
@@ -211,7 +211,7 @@ WI.RecordingAction = class RecordingAction extends WI.Object
             if (context instanceof CanvasRenderingContext2D)
                 return context.getImageData(0, 0, context.canvas.width, context.canvas.height).data;
 
-            if (context instanceof WebGLRenderingContext || context instanceof WebGL2RenderingContext) {
+            if (context instanceof WebGLRenderingContext || (window.WebGL2RenderingContext && context instanceof WebGL2RenderingContext)) {
                 let pixels = new Uint8Array(context.drawingBufferWidth * context.drawingBufferHeight * 4);
                 context.readPixels(0, 0, context.canvas.width, context.canvas.height, context.RGBA, context.UNSIGNED_BYTE, pixels);
                 return pixels;