Bug 1259228 - Fix shortcut bug in performance tools r=jsantell
authorGreg Tatum <tatum.creative@gmail.com>
Fri, 08 Jul 2016 08:07:00 +0200
changeset 304587 3cfd5be71eed88f862b030c7bb50066d4a05b060
parent 304586 4d012e675ac36a2b544b7770736a46c762212a79
child 304588 d192030869ef289c9fc5e9bdfcea37f2a24f7967
push id19955
push usercbook@mozilla.com
push dateTue, 12 Jul 2016 09:53:03 +0000
treeherderfx-team@3cfd5be71eed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell
bugs1259228
milestone50.0a1
Bug 1259228 - Fix shortcut bug in performance tools r=jsantell
devtools/client/performance/performance-view.js
--- a/devtools/client/performance/performance-view.js
+++ b/devtools/client/performance/performance-view.js
@@ -113,16 +113,24 @@ var PerformanceView = {
     yield DetailsView.destroy();
   }),
 
   /**
    * Sets the state of the profiler view. Possible options are "unavailable",
    * "empty", "recording", "console-recording", "recorded".
    */
   setState: function (state) {
+    // Make sure that the focus isn't captured on a hidden iframe. This fixes a
+    // XUL bug where shortcuts stop working.
+    const iframes = window.document.querySelectorAll('iframe');
+    for (let iframe of iframes) {
+      iframe.blur();
+    }
+    window.focus();
+
     let viewConfig = this.states[state];
     if (!viewConfig) {
       throw new Error(`Invalid state for PerformanceView: ${state}`);
     }
     for (let { sel, opt, val } of viewConfig) {
       for (let el of $$(sel)) {
         el[opt] = val();
       }