about:startup - small cleanup
authorDaniel Brooks <db48x@db48x.net>
Mon, 13 Sep 2010 04:51:36 -0400
changeset 58837 a8c463d09234b158ce80346824c1c1907fb421d5
parent 58836 906ff114be2539484084743d537ab76bb6b0636c
child 58838 ea4f08e2bd70678fcfe0dc7734b3427cbe374481
push id17440
push userdb48x@yahoo.com
push dateWed, 08 Dec 2010 04:15:54 +0000
treeherdermozilla-central@a89f24bf1798 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
about:startup - small cleanup
toolkit/content/aboutStartup.js
--- a/toolkit/content/aboutStartup.js
+++ b/toolkit/content/aboutStartup.js
@@ -58,32 +58,31 @@ var overviewOpts = $.extend(true, {}, op
 
 var series = [{ label: "Launch Time",
                 data: []
               },
               { label: "Startup Time",
                 data: []
               }
              ];
-var table = document.getElementsByTagName("table")[1];
-
 var file = Components.classes["@mozilla.org/file/directory_service;1"]
                      .getService(Components.interfaces.nsIProperties)
                      .get("ProfD", Components.interfaces.nsIFile);
 file.append("startup.sqlite");
 
 var svc = Components.classes["@mozilla.org/storage/service;1"]
                     .getService(Components.interfaces.mozIStorageService);
 var db = svc.openDatabase(file);
 var query = db.createStatement("SELECT timestamp, launch, startup, appVersion, appBuild, platformVersion, platformBuild FROM duration");
 var lastver, lastbuild;
 query.executeAsync({
   handleResult: function(results)
   {
     let hasresults = false;
+    let table = document.getElementById("duration-table");
     for (let row = results.getNextRow(); row; row = results.getNextRow())
     {
       hasresults = true;
       let stamp = row.getResultByName("timestamp");
       let version = row.getResultByName("appVersion");
       let build = row.getResultByName("appBuild");
       if (lastver != version)
       {
@@ -108,17 +107,17 @@ query.executeAsync({
                            td(row.getResultByName("platformVersion")),
                            td(row.getResultByName("platformBuild"))));
     }
     if (hasresults)
       $("#duration-table > .empty").hide();
   },
   handleError: function(error)
   {
-    table.appendChild(tr(td("Error: "+ error.message +" ("+ error.result +")")));
+    $("#duration-table").appendChild(tr(td("Error: "+ error.message +" ("+ error.result +")")));
   },
   handleCompletion: function()
   {
     var table = $("table");
     var height = $(window).height() - (table.offset().top + table.outerHeight(true)) - 110;
     $("#graph").height(Math.max(350, height));
 
     options.xaxis.min = Date.now() - 604800000; // 7 days in milliseconds