Web Inspector: Canvas: previews aren't removed when the parent view is hidden
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2018 23:52:09 +0000 (23:52 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2018 23:52:09 +0000 (23:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190525

Reviewed by Matt Baker.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.attached):

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.get canvases):
(WI.CanvasManager.prototype.get shaderPrograms):
Drive-by: simplify these getters.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js

index f204e3d..87aca02 100644 (file)
@@ -1,3 +1,18 @@
+2018-10-12  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Canvas: previews aren't removed when the parent view is hidden
+        https://bugs.webkit.org/show_bug.cgi?id=190525
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/CanvasTabContentView.js:
+        (WI.CanvasTabContentView.prototype.attached):
+
+        * UserInterface/Controllers/CanvasManager.js:
+        (WI.CanvasManager.prototype.get canvases):
+        (WI.CanvasManager.prototype.get shaderPrograms):
+        Drive-by: simplify these getters.
+
 2018-10-12  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Dark Mode: Highlight text in Network Headers search is too dark
index 303a662..fd2f86f 100644 (file)
@@ -42,12 +42,12 @@ WI.CanvasManager = class CanvasManager extends WI.Object
 
     get canvases()
     {
-        return [...this._canvasIdentifierMap.values()];
+        return Array.from(this._canvasIdentifierMap.values());
     }
 
     get shaderPrograms()
     {
-        return [...this._shaderProgramIdentifierMap.values()];
+        return Array.from(this._shaderProgramIdentifierMap.values());
     }
 
     importRecording()
index f0f5ad5..92ffa5d 100644 (file)
@@ -127,10 +127,10 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
         WI.canvasManager.addEventListener(WI.CanvasManager.Event.RecordingImported, this._recordingImportedOrStopped, this);
         WI.Canvas.addEventListener(WI.Canvas.Event.RecordingStopped, this._recordingImportedOrStopped, this);
 
-        let canvases = new Set([...this._canvasCollection, ...WI.canvasManager.canvases]);
+        let canvases = WI.canvasManager.canvases;
 
         for (let canvas of this._canvasCollection) {
-            if (!canvases.has(canvas))
+            if (!canvases.includes(canvas))
                 this._removeCanvas(canvas);
         }