Make the selected item in the accordion a link to the flakiness dashboard
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 22:52:42 +0000 (22:52 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 22:52:42 +0000 (22:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81571

Reviewed by Dimitri Glazkov.

Also, make it so that you can select the text of the link, instead of the current behavior
of acting as if you had clicked on the accordion header.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:

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

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css
Tools/ChangeLog

index 57e788d..515c814 100644 (file)
@@ -173,13 +173,18 @@ ui.results.TestSelector = base.extends('div', {
         this._length = 0;
 
         Object.keys(resultsByTest).sort().forEach(function(testName) {
-            var link = document.createElement('a');
-            $(link).attr('href', '#').text(testName);
+            var nonLinkTitle = document.createElement('a');
+            $(nonLinkTitle).addClass('non-link-title');
+            $(nonLinkTitle).attr('href', "#").text(testName);
+
+            var linkTitle = document.createElement('a');
+            $(linkTitle).addClass('link-title');
+            $(linkTitle).attr('href', ui.urlForFlakinessDashboard([testName])).text(testName);
 
             var header = document.createElement('h3');
             $(header).append(new ui.actions.List([
                 new ui.actions.Rebaseline().makeDefault(),
-            ])).append(link);
+            ])).append(nonLinkTitle).append(linkTitle);
             this.appendChild(header);
             this.appendChild(this._delegate.contentForTest(testName));
             ++this._length; // There doesn't seem to be any good way to get this information from accordion.
@@ -188,8 +193,15 @@ ui.results.TestSelector = base.extends('div', {
         $(this).accordion({
             collapsible: true,
             autoHeight: false,
+            event: 'customaccordianclick',
         });
         $(this).accordion('activate', false);
+
+        // jQuery's builtin accordion overrides mousedown, which means you can't select the header text
+        // or click on the link to the flakiness dashboard.
+        $('.ui-accordion-header').live('click', function() {
+            $(this).trigger('customaccordianclick');
+        })
     },
     nextResult: function()
     {
@@ -236,7 +248,7 @@ ui.results.TestSelector = base.extends('div', {
     currentTestName: function()
     {
         var currentIndex = $(this).accordion('option', 'active');
-        return $('h3 a', this)[currentIndex].textContent;
+        return $('h3 .non-link-title', this)[currentIndex].textContent;
     }
 });
 
index c0e561e..b0b3502 100644 (file)
     width: 100%;
     height: auto;
 }
+
+.ui-state-default .link-title, .ui-state-default .link-title:link, .ui-state-default .link-title:visited {
+    display: none;
+}
+.ui-state-active .link-title, .ui-state-active .link-title:link, .ui-state-active .link-title:visited {
+    text-decoration: underline;
+    display: inline-block;
+}
+.ui-state-active .non-link-title, .ui-state-active .non-link-title:link, .ui-state-active .non-link-title:visited {
+    display: none;
+}
index 4b30f4a..fdfeb38 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-19  Ojan Vafai  <ojan@chromium.org>
+
+        Make the selected item in the accordion a link to the flakiness dashboard
+        https://bugs.webkit.org/show_bug.cgi?id=81571
+
+        Reviewed by Dimitri Glazkov.
+
+        Also, make it so that you can select the text of the link, instead of the current behavior
+        of acting as if you had clicked on the accordion header.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:
+
 2012-03-19  Dirk Pranke  <dpranke@chromium.org>
 
         NRWT runs some tests that are skipped with -i command line option