Bug 1747422 - Rename the allDownloads list box. r=dao

* Having a different id for the container of download items in the download panel vs the all-downloads view (about:downloads and the library/places view) is one of the main reasons we need the %define item, to allow the same included stylesheet to apply to the different markup by virtue of the different selector produced when @item@ is expanded
* As these IDs aren't particularly descriptive, and the distinction isn't meaningful, having each list use the same id allows more direct stylesheet reuse in both places

Differential Revision: https://phabricator.services.mozilla.com/D135399
This commit is contained in:
Sam Foster
2022-01-16 10:54:32 +00:00
parent 3fc077adf7
commit 756ed30259
21 changed files with 34 additions and 32 deletions

View File

@@ -880,7 +880,7 @@ function goUpdateDownloadCommands() {
}
document.addEventListener("DOMContentLoaded", function() {
let richListBox = document.getElementById("downloadsRichListBox");
let richListBox = document.getElementById("downloadsListBox");
richListBox.addEventListener("scroll", function(event) {
return this._placesView.onScroll();
});

View File

@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#downloadsRichListBox:not(:empty) + #downloadsListEmptyDescription,
#downloadsRichListBox:empty {
#downloadsListBox:not(:empty) + #downloadsListEmptyDescription,
#downloadsListBox:empty {
display: none;
}

View File

@@ -10,14 +10,14 @@ const { PrivateBrowsingUtils } = ChromeUtils.import(
var ContentAreaDownloadsView = {
init() {
let box = document.getElementById("downloadsRichListBox");
let box = document.getElementById("downloadsListBox");
box.addEventListener(
"InitialDownloadsLoaded",
() => {
// Set focus to Downloads list once it is created
// And prevent it from showing the focus ring around the richlistbox (Bug 1702694)
document
.getElementById("downloadsRichListBox")
.getElementById("downloadsListBox")
.focus({ preventFocusRing: true });
},
{ once: true }

View File

@@ -41,7 +41,8 @@
<richlistbox flex="1"
seltype="multiple"
id="downloadsRichListBox"
id="downloadsListBox"
class="allDownloadsListBox"
context="downloadsContextMenu"/>
<description id="downloadsListEmptyDescription"
data-l10n-id="downloads-list-empty"/>

View File

@@ -29,7 +29,7 @@
/*** Downloads View ***/
#downloadsRichListBox > richlistitem button {
#downloadsListBox.allDownloadsListBox > richlistitem button {
/* These buttons should never get focus, as that would "disable"
the downloads view controller (it's only used when the richlistbox
is focused). */