Bug 596323 - Try delay loading the feedback UI to improve startup time [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Tue, 14 Sep 2010 17:04:12 -0400
changeset 66583 813715d4abe19855988afe5ebbd474a226557ecd
parent 66582 79354a0ee236ecd3eddab83478826983dbbc3c9a
child 66584 d4471d6d666ca499e616ff64640113d4ad0a907c
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs596323
Bug 596323 - Try delay loading the feedback UI to improve startup time [r=mbrubeck]
mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js
mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.xul
--- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js
+++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js
@@ -34,16 +34,25 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 var Feedback = {
   init: function(aEvent) {
     let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
     document.getElementById("feedback-about").setAttribute("desc", appInfo.version);
+
+    // Try to delay the widget initialization during startup
+    messageManager.addMessageListener("DOMContentLoaded", function() {
+      // We only want to delay one time
+      messageManager.removeMessageListener("DOMContentLoaded", arguments.callee, true);
+
+      // We unhide the panelUI so the XBL and settings can initialize
+      document.getElementById("feedback-container").hidden = false;
+    });
   },
 
   openReadme: function() {
     let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
     let url = formatter.formatURLPref("app.releaseNotesURL");
     BrowserUI.newTab(url);
   },
 
--- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.xul
+++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.xul
@@ -47,17 +47,17 @@
 <overlay id="feedback-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" src="chrome://feedback/content/overlay.js"/>
 
   <box id="panel-controls">
     <toolbarbutton id="tool-feedback" autocheck="true" type="radio" group="1" class="panel-button button-dark" linkedpanel="feedback-container" insertbefore="tool-addons"/>
   </box>
 
   <deck id="panel-items">
-    <vbox id="feedback-container" flex="1">
+    <vbox id="feedback-container" flex="1" hidden="true">
       <hbox id="feedback-header" class="panel-header">
         <label value="&feedbackHeader.label;" flex="1"/>
       </hbox>
       <notificationbox id="feedback-messages" flex="1">
         <richlistbox id="feedback-list" flex="1" onselect="this.ensureSelectedElementIsVisible()">
           <settings id="feedback-communicate" label="&feedback.communicate.title;">
             <setting title="&feedback.feedback.title;" type="control">
               <button id="feedback-feedback-happy" class="button-dark" oncommand="BrowserUI.newTab('http://m.input.mozilla.com/en-US/happy');"/>