Bug 1386576 - Use list-style-image rather than the image attribute for items in the back/forward menu so that CSS can override this to display back/forward icons. r=mak draft
authorDão Gottwald <dao@mozilla.com>
Wed, 02 Aug 2017 14:46:08 +0200
changeset 619690 f704978f2bba7cba24bbbead6dde59d040b6dfce
parent 619581 52285ea5e54c73d3ed824544cef2ee3f195f05e6
child 640487 70c38f4d81900c2db699f45c1b0302f15abe1ece
push id71778
push userdgottwald@mozilla.com
push dateWed, 02 Aug 2017 12:46:31 +0000
reviewersmak
bugs1386576
milestone57.0a1
Bug 1386576 - Use list-style-image rather than the image attribute for items in the back/forward menu so that CSS can override this to display back/forward icons. r=mak MozReview-Commit-ID: LvnpJlGlOqk
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4092,18 +4092,20 @@ function FillHistoryMenu(aParent) {
       item.setAttribute("uri", uri);
       item.setAttribute("label", entry.title || uri);
       item.setAttribute("index", j);
 
       // Cache this so that gotoHistoryIndex doesn't need the original index
       item.setAttribute("historyindex", j - index);
 
       if (j != index) {
-        item.setAttribute("image",
-                          PlacesUtils.urlWithSizeRef(window, "page-icon:" + uri, 16));
+        // Use list-style-image rather than the image attribute in order to
+        // allow CSS to override this.
+        item.style.listStyleImage =
+          "url(" + PlacesUtils.urlWithSizeRef(window, "page-icon:" + uri, 16) + ")";
       }
 
       if (j < index) {
         item.className = "unified-nav-back menuitem-iconic menuitem-with-favicon";
         item.setAttribute("tooltiptext", tooltipBack);
       } else if (j == index) {
         item.setAttribute("type", "radio");
         item.setAttribute("checked", "true");