Web Inspector: prevent Canvas tab from listening for "space" when not visibile
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 19:13:00 +0000 (19:13 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 19:13:00 +0000 (19:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190988

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.prototype.shown):
(WI.CanvasTabContentView.prototype.hidden): Added.

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

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

index 3d52fcd..9b20576 100644 (file)
@@ -1,3 +1,15 @@
+2018-10-29  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: prevent Canvas tab from listening for "space" when not visibile
+        https://bugs.webkit.org/show_bug.cgi?id=190988
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/CanvasTabContentView.js:
+        (WI.CanvasTabContentView):
+        (WI.CanvasTabContentView.prototype.shown):
+        (WI.CanvasTabContentView.prototype.hidden): Added.
+
 2018-10-27  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Table should support deleting rows
index 933211c..347c524 100644 (file)
@@ -50,9 +50,11 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
 
         this._recordShortcut = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.Space, this._handleSpace.bind(this));
         this._recordShortcut.implicitlyPreventsDefault = false;
+        this._recordShortcut.disabled = true;
 
         this._recordSingleFrameShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift, WI.KeyboardShortcut.Key.Space, this._handleSpace.bind(this));
         this._recordSingleFrameShortcut.implicitlyPreventsDefault = false;
+        this._recordSingleFrameShortcut.disabled = true;
     }
 
     static tabInfo()
@@ -102,10 +104,21 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
     {
         super.shown();
 
+        this._recordShortcut.disabled = false;
+        this._recordSingleFrameShortcut.disabled = false;
+
         if (!this.contentBrowser.currentContentView)
             this.showRepresentedObject(this._canvasCollection);
     }
 
+    hidden()
+    {
+        this._recordShortcut.disabled = true;
+        this._recordSingleFrameShortcut.disabled = true;
+
+        super.hidden();
+    }
+
     restoreStateFromCookie(cookie)
     {
         // FIXME: implement once <https://webkit.org/b/177606> is complete.