Bug 1374101, part 1 - Convert chrome://browser/skin/sync-desktopIcon.svg and its consumers to use SVG image context paint. r=johannh draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 24 May 2017 15:00:32 +0100
changeset 596204 011f9395779df02f52b6b8f89aca362f1198f448
parent 596203 f94508e9aa9ac6dab93e453d7991c03d1a63e8d5
child 596205 08ac4520766f23dd642c3a5122481c2511af7308
push id64541
push userjwatt@jwatt.org
push dateMon, 19 Jun 2017 00:05:26 +0000
reviewersjohannh
bugs1374101
milestone56.0a1
Bug 1374101, part 1 - Convert chrome://browser/skin/sync-desktopIcon.svg and its consumers to use SVG image context paint. r=johannh MozReview-Commit-ID: 96dYUi4gmGf
browser/themes/shared/sync-desktopIcon.svg
browser/themes/shared/syncedtabs/sidebar.inc.css
--- a/browser/themes/shared/sync-desktopIcon.svg
+++ b/browser/themes/shared/sync-desktopIcon.svg
@@ -1,22 +1,9 @@
 <!-- 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/. -->
-<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    g:not(:target) { display: none; }
-
-    .glyph { fill: #4d4d4d; }
-    .glyph.translucent { fill-opacity: .15; }
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="16" height="16" viewBox="0 0 16 16">
+  <path fill="context-fill" d="M15,14H1a1,1,0,0,1-1-1V12.526H16V13A1,1,0,0,1,15,14ZM1,4A1,1,0,0,1,2,3H14a1,1,0,0,1,1,1v8H1V4Zm1,7H14V4H2v7Z"/>
+  <rect fill="context-fill" fill-opacity="0.15" x="2" y="4" width="12" height="7"/>
+</svg>
 
-    .inverted .glyph { fill: #fff; }
-    .inverted .glyph.translucent { fill-opacity: .15; }
-  </style>
-  <g id="icon">
-    <path class="glyph" d="M15,14H1a1,1,0,0,1-1-1V12.526H16V13A1,1,0,0,1,15,14ZM1,4A1,1,0,0,1,2,3H14a1,1,0,0,1,1,1v8H1V4Zm1,7H14V4H2v7Z"/>
-    <rect class="glyph translucent" x="2" y="4" width="12" height="7"/>
-  </g>
-  <g id="icon-inverted" class="inverted">
-    <path class="glyph" d="M15,14H1a1,1,0,0,1-1-1V12.526H16V13A1,1,0,0,1,15,14ZM1,4A1,1,0,0,1,2,3H14a1,1,0,0,1,1,1v8H1V4Zm1,7H14V4H2v7Z"/>
-    <rect class="glyph translucent" x="2" y="4" width="12" height="7"/>
-  </g>
-</svg>
--- a/browser/themes/shared/syncedtabs/sidebar.inc.css
+++ b/browser/themes/shared/syncedtabs/sidebar.inc.css
@@ -85,21 +85,23 @@ body {
   padding-inline-start: 35px;
 }
 
 .item.tab > .item-title-container {
   padding-inline-start: 20px;
 }
 
 .item.client.device-image-desktop > .item-title-container > .item-icon-container {
-  background-image: url("chrome://browser/skin/sync-desktopIcon.svg#icon");
+  background-image: url("chrome://browser/skin/sync-desktopIcon.svg");
+  -moz-context-properties: fill;
+  fill: #4d4d4d;
 }
 
 .item.client.device-image-desktop.selected:focus > .item-title-container > .item-icon-container {
-  background-image: url("chrome://browser/skin/sync-desktopIcon.svg#icon-inverted");
+  fill: white;
 }
 
 .item.client.device-image-mobile > .item-title-container > .item-icon-container {
   background-image: url("chrome://browser/skin/sync-mobileIcon.svg#icon");
 }
 
 .item.client.device-image-mobile.selected:focus > .item-title-container > .item-icon-container {
   background-image: url("chrome://browser/skin/sync-mobileIcon.svg#icon-inverted");