Bug 1374106, part 3 - Split up the video control closed captions on/off icon and convert it to use SVG context paint. r=dao draft
authorJonathan Watt <jwatt@jwatt.org>
Fri, 26 May 2017 17:04:36 +0100
changeset 597660 aed97c47160b7d0b4a13c55819b98ec4f54d02eb
parent 597659 cc8aec2df638b62cbbd4c4966fc3bfb70dd62247
child 597661 e748b61c55e4feec944fedb9853a62c2512b06af
push id64983
push userjwatt@jwatt.org
push dateTue, 20 Jun 2017 19:41:57 +0000
reviewersdao
bugs1374106
milestone56.0a1
Bug 1374106, part 3 - Split up the video control closed captions on/off icon and convert it to use SVG context paint. r=dao MozReview-Commit-ID: B6jHacoDYtJ
toolkit/themes/shared/jar.inc.mn
toolkit/themes/shared/media/closedCaptionButton-cc-off.svg
toolkit/themes/shared/media/closedCaptionButton-cc-on.svg
toolkit/themes/shared/media/closedCaptionButton.svg
toolkit/themes/shared/media/videocontrols.css
--- a/toolkit/themes/shared/jar.inc.mn
+++ b/toolkit/themes/shared/jar.inc.mn
@@ -67,23 +67,24 @@ toolkit.jar:
   skin/classic/global/reader/RM-Type-Controls-Arrow.svg    (../../shared/reader/RM-Type-Controls-Arrow.svg)
   skin/classic/global/reader/RM-Content-Width-Minus-42x16.svg            (../../shared/reader/RM-Content-Width-Minus-42x16.svg)
   skin/classic/global/reader/RM-Content-Width-Plus-44x16.svg             (../../shared/reader/RM-Content-Width-Plus-44x16.svg)
   skin/classic/global/reader/RM-Line-Height-Minus-38x14.svg            (../../shared/reader/RM-Line-Height-Minus-38x14.svg)
   skin/classic/global/reader/RM-Line-Height-Plus-38x24.svg             (../../shared/reader/RM-Line-Height-Plus-38x24.svg)
   skin/classic/global/media/audioMutedButton.svg           (../../shared/media/audioMutedButton.svg)
   skin/classic/global/media/audioNoAudioButton.svg         (../../shared/media/audioNoAudioButton.svg)
   skin/classic/global/media/audioUnmutedButton.svg         (../../shared/media/audioUnmutedButton.svg)
+  skin/classic/global/media/closedCaptionButton-cc-off.svg (../../shared/media/closedCaptionButton-cc-off.svg)
+  skin/classic/global/media/closedCaptionButton-cc-on.svg  (../../shared/media/closedCaptionButton-cc-on.svg)
   skin/classic/global/media/TopLevelImageDocument.css      (../../shared/media/TopLevelImageDocument.css)
   skin/classic/global/media/TopLevelVideoDocument.css      (../../shared/media/TopLevelVideoDocument.css)
   skin/classic/global/media/imagedoc-lightnoise.png        (../../shared/media/imagedoc-lightnoise.png)
   skin/classic/global/media/imagedoc-darknoise.png         (../../shared/media/imagedoc-darknoise.png)
 * skin/classic/global/media/videocontrols.css              (../../shared/media/videocontrols.css)
   skin/classic/global/media/pauseButton.svg                (../../shared/media/pauseButton.svg)
   skin/classic/global/media/playButton.svg                 (../../shared/media/playButton.svg)
-  skin/classic/global/media/closedCaptionButton.svg        (../../shared/media/closedCaptionButton.svg)
   skin/classic/global/media/fullscreenButton.svg           (../../shared/media/fullscreenButton.svg)
   skin/classic/global/media/error.png                      (../../shared/media/error.png)
   skin/classic/global/media/throbber.png                   (../../shared/media/throbber.png)
   skin/classic/global/media/stalled.png                    (../../shared/media/stalled.png)
 #ifdef MOZ_PLACES
   skin/classic/mozapps/places/defaultFavicon.svg           (../../shared/places/defaultFavicon.svg)
 #endif
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/shared/media/closedCaptionButton-cc-off.svg
@@ -0,0 +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/. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="18px" height="18px" viewBox="0 0 18 18">
+  <path fill="context-fill" fill-rule="evenodd"
+        d="M16.531,16.107H5.267l1.982-2H15c0.6,0,1-0.4,1-1V5.274
+           l1.946-1.964C17.963,3.399,18,3.483,18,3.576v11.031C18,15.407,17.331,16.107,16.531,16.107z M14.016,8.506h-1.218l1.005-1.014
+           C13.913,7.789,13.984,8.128,14.016,8.506z M11.786,12.361c-0.828,0-1.476-0.326-1.913-0.902l1.09-1.101
+           c0.136,0.323,0.374,0.541,0.796,0.541c0.514,0,0.695-0.44,0.756-1.014h1.535C13.908,11.43,13.071,12.361,11.786,12.361z
+           M1.496,16.106C0.697,16.104,0,15.406,0,14.607V3.576c0-0.8,0.7-1.5,1.5-1.5h12.846L16.299,0l1.316,1.283L2.615,17.13L1.496,16.106
+           z M3,4.107c-0.6,0-1,0.4-1,1v8c0,0.6,0.4,1,1,1h0.029l2.031-2.16c-0.757-0.503-1.191-1.457-1.191-2.744
+           c0-1.936,1.069-3.14,2.428-3.14c1.357,0,2.136,0.76,2.361,2.059l3.777-4.016H3z M8.298,8.506H7.355
+           c-0.047-0.623-0.49-1.23-0.99-1.23c-0.561,0-1.337,0.84-1.337,1.995c0,0.674,0.381,1.427,0.95,1.702L8.298,8.506z"/>
+</svg>
+
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/shared/media/closedCaptionButton-cc-on.svg
@@ -0,0 +1,17 @@
+<!-- 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 xmlns="http://www.w3.org/2000/svg"
+     width="18px" height="18px" viewBox="0 0 18 18">
+  <path fill="context-fill"
+        d="M16.531,1.984H1.5c-0.8,0-1.5,0.7-1.5,1.5v11.031c0,0.8,0.7,1.5,1.5,1.5h15.031
+           c0.8,0,1.469-0.7,1.469-1.5V3.484C18,2.684,17.331,1.984,16.531,1.984z
+           M16,13.016c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1v-8c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1V13.016z
+           M6.426,10.807c-0.811,0-0.96-0.789-0.96-1.628c0-1.155,0.338-1.745,0.899-1.745c0.5,0,0.818,0.357,0.866,0.98
+           h1.484C8.585,6.877,7.785,5.972,6.297,5.972c-1.359,0-2.428,1.205-2.428,3.14c0,1.944,0.974,3.157,2.583,3.157
+           c1.285,0,2.153-0.93,2.295-2.476H7.244C7.183,10.367,6.94,10.807,6.426,10.807z
+           M11.759,10.807c-0.811,0-0.96-0.789-0.96-1.628c0-1.155,0.338-1.745,0.899-1.745c0.5,0,0.756,0.357,0.803,0.98h1.515
+           c-0.129-1.537-0.898-2.443-2.385-2.443c-1.359,0-2.396,1.205-2.396,3.14c0,1.944,0.943,3.157,2.552,3.157
+           c1.285,0,2.122-0.93,2.264-2.476h-1.535C12.454,10.367,12.273,10.807,11.759,10.807z"/>
+</svg>
+
deleted file mode 100644
--- a/toolkit/themes/shared/media/closedCaptionButton.svg
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 18 18">
-  <style>
-    use:not(:target) {
-      display: none;
-    }
-    use {
-      fill: #ffffff;
-    }
-    use[id$="-hover"] {
-      fill: #48a0f7;
-    }
-    use[id$="-active"] {
-      fill: #2d89e6;
-    }
-    use[id$="-focus"] {
-      fill: #48a0f7;
-    }
-    use[id$="-disabled"] {
-      fill: #ffffff;
-    }
-  </style>
-  <symbol id="cc-off-shape">
-    <path fill-rule="evenodd" clip-rule="evenodd" d="M16.531,16.107H5.267l1.982-2H15c0.6,0,1-0.4,1-1V5.274
-      l1.946-1.964C17.963,3.399,18,3.483,18,3.576v11.031C18,15.407,17.331,16.107,16.531,16.107z M14.016,8.506h-1.218l1.005-1.014
-      C13.913,7.789,13.984,8.128,14.016,8.506z M11.786,12.361c-0.828,0-1.476-0.326-1.913-0.902l1.09-1.101
-      c0.136,0.323,0.374,0.541,0.796,0.541c0.514,0,0.695-0.44,0.756-1.014h1.535C13.908,11.43,13.071,12.361,11.786,12.361z
-       M1.496,16.106C0.697,16.104,0,15.406,0,14.607V3.576c0-0.8,0.7-1.5,1.5-1.5h12.846L16.299,0l1.316,1.283L2.615,17.13L1.496,16.106
-      z M3,4.107c-0.6,0-1,0.4-1,1v8c0,0.6,0.4,1,1,1h0.029l2.031-2.16c-0.757-0.503-1.191-1.457-1.191-2.744
-      c0-1.936,1.069-3.14,2.428-3.14c1.357,0,2.136,0.76,2.361,2.059l3.777-4.016H3z M8.298,8.506H7.355
-      c-0.047-0.623-0.49-1.23-0.99-1.23c-0.561,0-1.337,0.84-1.337,1.995c0,0.674,0.381,1.427,0.95,1.702L8.298,8.506z"/>
-  </symbol>
-
-  <symbol id="cc-shape">
-    <path d="M16.531,1.984H1.5c-0.8,0-1.5,0.7-1.5,1.5v11.031c0,0.8,0.7,1.5,1.5,1.5h15.031
-      c0.8,0,1.469-0.7,1.469-1.5V3.484C18,2.684,17.331,1.984,16.531,1.984z M16,13.016c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1v-8
-      c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1V13.016z M6.426,10.807c-0.811,0-0.96-0.789-0.96-1.628c0-1.155,0.338-1.745,0.899-1.745
-      c0.5,0,0.818,0.357,0.866,0.98h1.484C8.585,6.877,7.785,5.972,6.297,5.972c-1.359,0-2.428,1.205-2.428,3.14
-      c0,1.944,0.974,3.157,2.583,3.157c1.285,0,2.153-0.93,2.295-2.476H7.244C7.183,10.367,6.94,10.807,6.426,10.807z M11.759,10.807
-      c-0.811,0-0.96-0.789-0.96-1.628c0-1.155,0.338-1.745,0.899-1.745c0.5,0,0.756,0.357,0.803,0.98h1.515
-      c-0.129-1.537-0.898-2.443-2.385-2.443c-1.359,0-2.396,1.205-2.396,3.14c0,1.944,0.943,3.157,2.552,3.157
-      c1.285,0,2.122-0.93,2.264-2.476h-1.535C12.454,10.367,12.273,10.807,11.759,10.807z"/>
-  </symbol>
-  <use id="cc" xlink:href="#cc-shape"/>
-  <use id="cc-hover" xlink:href="#cc-shape"/>
-  <use id="cc-active" xlink:href="#cc-shape"/>
-  <use id="cc-focus" xlink:href="#cc-shape"/>
-  <use id="cc-disabled" xlink:href="#cc-shape"/>
-
-  <use id="cc-off" xlink:href="#cc-off-shape"/>
-  <use id="cc-off-hover" xlink:href="#cc-off-shape"/>
-  <use id="cc-off-active" xlink:href="#cc-off-shape"/>
-  <use id="cc-off-focus" xlink:href="#cc-off-shape"/>
-  <use id="cc-off-disabled" xlink:href="#cc-off-shape"/>
-</svg>
--- a/toolkit/themes/shared/media/videocontrols.css
+++ b/toolkit/themes/shared/media/videocontrols.css
@@ -93,22 +93,24 @@ audio > xul|videocontrols {
   background-position: center;
   background-origin: content-box;
   background-clip: content-box;
   -moz-context-properties: fill;
   fill: #ffffff;
 }
 
 .playButton:hover,
-.muteButton:hover {
+.muteButton:hover,
+.closedCaptionButton:hover {
   fill: #48a0f7;
 }
 
 .playButton:hover:active,
-.muteButton:hover:active {
+.muteButton:hover:active,
+.closedCaptionButton:hover:active {
   fill: #2d89e6;
 }
 
 .playButton {
   background-image: url(chrome://global/skin/media/pauseButton.svg);
 }
 .playButton[paused] {
   background-image: url(chrome://global/skin/media/playButton.svg);
@@ -126,32 +128,20 @@ audio > xul|videocontrols {
   background-image: url(chrome://global/skin/media/audioNoAudioButton.svg);
   fill: white;
 }
 .muteButton[noAudio] + .volumeStack {
   display: none;
 }
 
 .closedCaptionButton {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc-off);
-}
-.closedCaptionButton:hover {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc-off-hover);
-}
-.closedCaptionButton:hover:active {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc-off-active);
+  background-image: url(chrome://global/skin/media/closedCaptionButton-cc-off.svg);
 }
 .closedCaptionButton[enabled] {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc);
-}
-.closedCaptionButton[enabled]:hover {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc-hover);
-}
-.closedCaptionButton[enabled]:hover:active {
-  background-image: url(chrome://global/skin/media/closedCaptionButton.svg#cc-active);
+  background-image: url(chrome://global/skin/media/closedCaptionButton-cc-on.svg);
 }
 
 .fullscreenButton {
   background-image: url(chrome://global/skin/media/fullscreenButton.svg#fullscreen);
 }
 .fullscreenButton:hover {
   background-image: url(chrome://global/skin/media/fullscreenButton.svg#fullscreen-hover);
 }