Bug 1117145 - Part 1 - Unify the functional CSS files for the Downloads Panel and the Library. r=jaws
MozReview-Commit-ID: 1CUvG6ucBQq
deleted file mode 100644
--- a/browser/components/downloads/content/allDownloadsViewOverlay.css
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-/**
- * The downloads richlistbox may list thousands of items, and it turns out
- * XBL binding attachment, and even more so detachment, is a performance hog.
- * This hack makes sure we don't apply any binding to inactive items (inactive
- * items are history downloads that haven't been in the visible area).
- * We can do this because the richlistbox implementation does not interact
- * much with the richlistitem binding. However, this may turn out to have
- * some side effects (see bug 828111 for the details).
- *
- * We might be able to do away with this workaround once bug 653881 is fixed.
- */
-richlistitem.download {
- -moz-binding: none;
-}
-
-richlistitem.download[active] {
- -moz-binding: url('chrome://browser/content/downloads/download.xml#download-full-ui');
-}
-
-.download-state:not( [state="0"] /* Downloading */)
- .downloadPauseMenuItem,
-.download-state:not( [state="4"] /* Paused */)
- .downloadResumeMenuItem,
-.download-state:not(:-moz-any([state="2"], /* Failed */
- [state="4"]) /* Paused */)
- .downloadCancelMenuItem,
-/* Blocked (dirty) downloads that have not been confirmed and
- have temporary data. */
-.download-state:not( [state="8"] /* Blocked (dirty) */)
- .downloadUnblockMenuItem,
-.download-state[state="8"]:not(.temporary-block)
- .downloadUnblockMenuItem,
-.download-state[state]:not(:-moz-any([state="1"], /* Finished */
- [state="2"], /* Failed */
- [state="3"], /* Canceled */
- [state="6"], /* Blocked (parental) */
- [state="8"], /* Blocked (dirty) */
- [state="9"]) /* Blocked (policy) */)
- .downloadRemoveFromHistoryMenuItem,
-.download-state:not(:-moz-any([state="-1"],/* Starting (initial) */
- [state="0"], /* Downloading */
- [state="1"], /* Finished */
- [state="4"], /* Paused */
- [state="5"]) /* Starting (queued) */)
- .downloadShowMenuItem,
-.download-state[state="7"] .downloadCommandsSeparator
-{
- display: none;
-}
--- a/browser/components/downloads/content/allDownloadsViewOverlay.xul
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.xul
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
-<?xml-stylesheet href="chrome://browser/content/downloads/allDownloadsViewOverlay.css"?>
+<?xml-stylesheet href="chrome://browser/content/downloads/downloads.css"?>
<?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?>
<!DOCTYPE overlay [
<!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
%downloadsDTD;
]>
<!-- This overlay provides a downloads view that lists both session downloads,
deleted file mode 100644
--- a/browser/components/downloads/content/download.css
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-richlistitem.download button {
- /* These buttons should never get focus, as that would "disable"
- the downloads view controller (it's only used when the richlistbox
- is focused). */
- -moz-user-focus: none;
-}
-
-/*** Visibility of controls inside download items ***/
-
-.download-state:-moz-any( [state="6"], /* Blocked (parental) */
- [state="8"], /* Blocked (dirty) */
- [state="9"]) /* Blocked (policy) */
- > .downloadTypeIcon:not(.blockedIcon),
-
-.download-state:not(:-moz-any([state="6"], /* Blocked (parental) */
- [state="8"], /* Blocked (dirty) */
- [state="9"]) /* Blocked (policy) */)
- > .downloadTypeIcon.blockedIcon,
-
-.download-state:not(:-moz-any([state="-1"],/* Starting (initial) */
- [state="5"], /* Starting (queued) */
- [state="0"], /* Downloading */
- [state="4"], /* Paused */
- [state="7"]) /* Scanning */)
- > vbox > .downloadProgress,
-
-.download-state:not(:-moz-any([state="-1"],/* Starting (initial) */
- [state="5"], /* Starting (queued) */
- [state="0"], /* Downloading */
- [state="4"]) /* Paused */)
- > .downloadCancel,
-
-/* Blocked (dirty) downloads that have not been confirmed and
- have temporary data. */
-.download-state:not( [state="8"])
- > .downloadConfirmBlock,
-.download-state[state="8"]:not(.temporary-block)
- > .downloadConfirmBlock,
-
-.download-state[state]:not(:-moz-any([state="2"], /* Failed */
- [state="3"]) /* Canceled */)
- > .downloadRetry,
-
-.download-state:not( [state="1"] /* Finished */)
- > .downloadShow
-{
- display: none;
-}
--- a/browser/components/downloads/content/download.xml
+++ b/browser/components/downloads/content/download.xml
@@ -64,20 +64,16 @@
tooltiptext="&cmd.removeFile.label;"
oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_confirmBlock');"/>
</xul:stack>
</content>
</binding>
<binding id="download-full-ui"
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
- <resources>
- <stylesheet src="chrome://browser/content/downloads/download.css"/>
- </resources>
-
<content orient="horizontal" align="center">
<xul:image class="downloadTypeIcon"
validate="always"
xbl:inherits="src=image"/>
<xul:image class="downloadTypeIcon blockedIcon"/>
<xul:vbox pack="center" flex="1">
<xul:description class="downloadTarget"
crop="center"
@@ -87,33 +83,34 @@
min="0"
max="100"
xbl:inherits="mode=progressmode,value=progress"/>
<xul:description class="downloadDetails"
style="width: &downloadDetails.width;"
crop="end"
xbl:inherits="value=status,tooltiptext=statusTip"/>
</xul:vbox>
-
- <xul:button class="downloadButton downloadCancel"
- tooltiptext="&cmd.cancel.label;"
- oncommand="goDoCommand('downloadsCmd_cancel')"/>
- <xul:button class="downloadButton downloadRetry"
- tooltiptext="&cmd.retry.label;"
- oncommand="goDoCommand('downloadsCmd_retry')"/>
- <xul:button class="downloadButton downloadShow"
+ <xul:stack>
+ <xul:button class="downloadButton downloadCancel"
+ tooltiptext="&cmd.cancel.label;"
+ oncommand="goDoCommand('downloadsCmd_cancel')"/>
+ <xul:button class="downloadButton downloadRetry"
+ tooltiptext="&cmd.retry.label;"
+ oncommand="goDoCommand('downloadsCmd_retry')"/>
+ <xul:button class="downloadButton downloadShow"
#ifdef XP_MACOSX
- tooltiptext="&cmd.showMac.label;"
+ tooltiptext="&cmd.showMac.label;"
#else
- tooltiptext="&cmd.show.label;"
+ tooltiptext="&cmd.show.label;"
#endif
- oncommand="goDoCommand('downloadsCmd_show')"/>
- <xul:button class="downloadButton downloadConfirmBlock"
- tooltiptext="&cmd.removeFile.label;"
- oncommand="goDoCommand('downloadsCmd_confirmBlock');"/>
+ oncommand="goDoCommand('downloadsCmd_show')"/>
+ <xul:button class="downloadButton downloadConfirmBlock"
+ tooltiptext="&cmd.removeFile.label;"
+ oncommand="goDoCommand('downloadsCmd_confirmBlock');"/>
+ </xul:stack>
</content>
</binding>
<binding id="download-toolbarbutton"
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
<content>
<children />
<xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
--- a/browser/components/downloads/content/downloads.css
+++ b/browser/components/downloads/content/downloads.css
@@ -1,23 +1,64 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-/*** Download items ***/
+/*** Downloads Panel ***/
richlistitem[type="download"] {
-moz-binding: url('chrome://browser/content/downloads/download.xml#download');
}
richlistitem[type="download"]:not([selected]) button {
/* Only focus buttons in the selected item. */
-moz-user-focus: none;
}
+richlistitem[type="download"].download-state[state="1"]:not([exists]) .downloadShow
+{
+ display: none;
+}
+
+#downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryProgress,
+#downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryDetails,
+#downloadsFooter[showingsummary] > #downloadsHistory,
+#downloadsFooter:not([showingsummary]) > #downloadsSummary
+{
+ display: none;
+}
+
+/*** Downloads View ***/
+
+/**
+ * The downloads richlistbox may list thousands of items, and it turns out
+ * XBL binding attachment, and even more so detachment, is a performance hog.
+ * This hack makes sure we don't apply any binding to inactive items (inactive
+ * items are history downloads that haven't been in the visible area).
+ * We can do this because the richlistbox implementation does not interact
+ * much with the richlistitem binding. However, this may turn out to have
+ * some side effects (see bug 828111 for the details).
+ *
+ * We might be able to do away with this workaround once bug 653881 is fixed.
+ */
+richlistitem.download {
+ -moz-binding: none;
+}
+
+richlistitem.download[active] {
+ -moz-binding: url("chrome://browser/content/downloads/download.xml#download-full-ui");
+}
+
+richlistitem.download button {
+ /* These buttons should never get focus, as that would "disable"
+ the downloads view controller (it's only used when the richlistbox
+ is focused). */
+ -moz-user-focus: none;
+}
+
/*** Visibility of controls inside download items ***/
.download-state:-moz-any( [state="6"], /* Blocked (parental) */
[state="8"], /* Blocked (dirty) */
[state="9"]) /* Blocked (policy) */
.downloadTypeIcon:not(.blockedIcon),
.download-state:not(:-moz-any([state="6"], /* Blocked (parental) */
@@ -90,21 +131,8 @@ richlistitem[type="download"]:not([selec
.downloadRetry,
.download-state:not( [state="1"] /* Finished */)
.downloadShow
{
visibility: hidden;
}
-
-.download-state[state="1"]:not([exists]) .downloadShow
-{
- display: none;
-}
-
-#downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryProgress,
-#downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryDetails,
-#downloadsFooter[showingsummary] > #downloadsHistory,
-#downloadsFooter:not([showingsummary]) > #downloadsSummary
-{
- display: none;
-}
--- a/browser/components/downloads/jar.mn
+++ b/browser/components/downloads/jar.mn
@@ -1,18 +1,16 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
browser.jar:
* content/browser/downloads/download.xml (content/download.xml)
- content/browser/downloads/download.css (content/download.css)
content/browser/downloads/downloads.css (content/downloads.css)
content/browser/downloads/downloads.js (content/downloads.js)
* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul)
content/browser/downloads/indicator.js (content/indicator.js)
content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul)
* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul)
content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js)
- content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css)
* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul)
content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js)
content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css)