Bug 842356 - Set focus to downloads list box in about:downloads page on page load if list not empty, and made background and focus ring transparent if list empty. r=mak
authorNicholas Parmar <n.parmar085@me.com>
Wed, 11 Nov 2015 21:18:00 +0100
changeset 308686 ea102921641595c8cf67c3296580ecb6700529ef
parent 308685 d3c2323985132f5858b36d923749c325b100def3
child 308687 5c98c715b5c7354522da176a19185f47f87e6adc
push id7514
push users.kaspari@gmail.com
push dateFri, 13 Nov 2015 14:12:41 +0000
reviewersmak
bugs842356
milestone45.0a1
Bug 842356 - Set focus to downloads list box in about:downloads page on page load if list not empty, and made background and focus ring transparent if list empty. r=mak
browser/components/downloads/content/contentAreaDownloadsView.js
browser/themes/shared/downloads/contentAreaDownloadsView.css
--- a/browser/components/downloads/content/contentAreaDownloadsView.js
+++ b/browser/components/downloads/content/contentAreaDownloadsView.js
@@ -6,10 +6,12 @@ Components.utils.import("resource://gre/
 
 var ContentAreaDownloadsView = {
   init() {
     let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
     // Do not display the Places downloads in private windows
     if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
       view.place = "place:transition=7&sort=4";
     }
+    // Set focus to Downloads list once it is created
+    document.getElementById("downloadsRichListBox").focus();
   },
 };
--- a/browser/themes/shared/downloads/contentAreaDownloadsView.css
+++ b/browser/themes/shared/downloads/contentAreaDownloadsView.css
@@ -3,18 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 @import url("chrome://global/skin/in-content/common.css");
 
 #contentAreaDownloadsView {
   padding: 18px;
 }
 
-#downloadsRichListBox:not(:-moz-focusring) {
+#downloadsRichListBox:empty {
   border-color: transparent;
+  background-color: transparent;
 }
 
 .downloadButton:not([disabled="true"]):hover,
 .downloadButton:not([disabled="true"]):hover:active,
 .downloadButton:not([disabled]):hover:active {
   background: transparent;
   border: none;
 }