Bug 1147552 - Add a yellow background on the active test item in the reftest analyzer. r=dbaron
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 26 Mar 2015 14:54:21 -0400
changeset 266278 765a0adb9d7cb221786d544984cc833a75536bd6
parent 266277 97d1d0f97785eea9f7dfa7a6ea70313161ad513c
child 266279 a2882af29c29c556704d0a201e5e94fc8aa5fe4b
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1147552
milestone39.0a1
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
Bug 1147552 - Add a yellow background on the active test item in the reftest analyzer. r=dbaron DONTBUILD because NPOTB
layout/tools/reftest/reftest-analyzer.xhtml
--- a/layout/tools/reftest/reftest-analyzer.xhtml
+++ b/layout/tools/reftest/reftest-analyzer.xhtml
@@ -38,16 +38,17 @@ Features to add:
 
   #leftpane { width: 320px; }
   #images { position: fixed; top: 10px; left: 340px; }
 
   form#imgcontrols { margin: 0; display: block; }
 
   #itemlist > table { border-collapse: collapse; }
   #itemlist > table > tbody > tr > td { border: 1px solid; padding: 1px; }
+  #itemlist td.activeitem { background-color: yellow; }
 
   /*
   #itemlist > table > tbody > tr.pass > td.url { background: lime; }
   #itemlist > table > tbody > tr.fail > td.url { background: red; }
   */
 
   #magnification > svg { display: block; width: 84px; height: 84px; }
 
@@ -290,16 +291,17 @@ function build_viewer() {
     text = "";
     if (item.unexpected) { text += "!"; rowclass += " unexpected"; }
     if (item.random) { text += "R"; rowclass += " random"; }
     if (item.skip) { text += "S"; rowclass += " skip"; }
     td.appendChild(document.createTextNode(text));
     tr.appendChild(td);
 
     td = document.createElement("td");
+    td.id = "item" + i;
     td.className = "url";
     // Only display part of URL after "/mozilla/".
     var match = item.url.match(/\/mozilla\/(.*)/);
     text = document.createTextNode(match ? match[1] : item.url);
     if (item.images.length > 0) {
       var a = document.createElement("a");
       a.href = "javascript:show_images(" + i + ")";
       a.appendChild(text);
@@ -339,16 +341,23 @@ function sync_svg_size(imageData) {
   ID("svg").setAttribute("width", imageData.width);
   ID("svg").setAttribute("height", imageData.height);
 }
 
 function show_images(i) {
   var item = gTestItems[i];
   var cell = ID("images");
 
+  // Remove activeitem class from any existing elements
+  var activeItems = document.querySelectorAll(".activeitem");
+  for (var activeItemIdx = activeItems.length; activeItemIdx-- != 0;) {
+    activeItems[activeItemIdx].classList.remove("activeitem");
+  }
+
+  ID("item" + i).classList.add("activeitem");
   ID("image1").style.display = "";
   ID("image2").style.display = "none";
   ID("diffrect").style.display = "none";
   ID("imgcontrols").reset();
 
   ID("image1").setAttributeNS(XLINK_NS, "xlink:href", item.images[0]);
   // Making the href be #image1 doesn't seem to work
   ID("feimage1").setAttributeNS(XLINK_NS, "xlink:href", item.images[0]);