Bug 1261223 - Synced Tabs now uses HiDPI default favicons. r=markh
☠☠ backed out by ff96d9731ec7 ☠ ☠
authorEdouard Oger <eoger@fastmail.com>
Mon, 04 Apr 2016 11:33:00 +0200
changeset 291591 902ee4a0983d6ddc446ee63da236c28b8125480e
parent 291590 9e6cc7e1a2236fdd61ba361c190dd7d32a5e9621
child 291592 5ce9826df5eef29a0697d644fa8280c41ea4b80b
push id18529
push usercbook@mozilla.com
push dateTue, 05 Apr 2016 03:55:22 +0000
treeherderfx-team@902ee4a0983d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1261223
milestone48.0a1
Bug 1261223 - Synced Tabs now uses HiDPI default favicons. r=markh
browser/components/syncedtabs/TabListView.js
browser/themes/shared/syncedtabs/sidebar.inc.css
services/sync/modules/SyncedTabs.jsm
--- a/browser/components/syncedtabs/TabListView.js
+++ b/browser/components/syncedtabs/TabListView.js
@@ -237,18 +237,20 @@ TabListView.prototype = {
     }
     if (item.focused) {
       itemNode.focus();
     }
     itemNode.dataset.url = item.url;
 
     itemNode.querySelector(".item-title").textContent = item.title;
 
-    let icon = itemNode.querySelector(".item-icon-container");
-    icon.style.backgroundImage = "url(" + item.icon + ")";
+    if (item.icon) {
+      let icon = itemNode.querySelector(".item-icon-container");
+      icon.style.backgroundImage = "url(" + item.icon + ")";
+    }
   },
 
   onClick(event) {
     let itemNode = this._findParentItemNode(event.target);
     if (!itemNode) {
       return;
     }
 
--- a/browser/themes/shared/syncedtabs/sidebar.inc.css
+++ b/browser/themes/shared/syncedtabs/sidebar.inc.css
@@ -79,20 +79,31 @@ body {
 .item.selected:focus > .item-title-container {
   background-color: Highlight;
   color: HighlightText;
 }
 
 .client .item.tab > .item-title-container {
   padding-inline-start: 35px;
 }
+
 .item.tab > .item-title-container {
   padding-inline-start: 20px;
 }
 
+.item.tab > .item-title-container > .item-icon-container {
+  background-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
+}
+
+@media (min-resolution: 1.1dppx) {
+.item.tab > .item-title-container > .item-icon-container {
+    background-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png");
+  }
+}
+
 .item-icon-container {
   min-width: 16px;
   max-width: 16px;
   min-height: 16px;
   max-height: 16px;
   margin-right: 5px;
   margin-left: 5px;
   background-size: 16px 16px;
--- a/services/sync/modules/SyncedTabs.jsm
+++ b/services/sync/modules/SyncedTabs.jsm
@@ -68,17 +68,17 @@ let SyncedTabsInternal = {
       icon = tab.icon;
     }
     if (!icon) {
       try {
         icon = (yield PlacesUtils.promiseFaviconLinkUrl(url)).spec;
       } catch (ex) { /* no favicon avaiable */ }
     }
     if (!icon) {
-      icon = PlacesUtils.favicons.defaultFavicon.spec;
+      icon = "";
     }
     return {
       type:  "tab",
       title: tab.title || url,
       url,
       icon,
       client: client.id,
       lastUsed: tab.lastUsed,