Bug 1468343 - Part 3: Change tooltip content to address infinity duration. r?jdescottes draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Fri, 22 Jun 2018 16:38:31 +0900
changeset 809489 9daaafdbe599a15691d694127203d37770c48d4d
parent 809488 c6d9d15dc5e1dd2ad5a029db6eda9b15ce489fe1
child 809490 c1b7cb32474f32e9d07beeb517129aeabfdf2148
push id113693
push userbmo:dakatsuka@mozilla.com
push dateFri, 22 Jun 2018 07:45:24 +0000
reviewersjdescottes
bugs1468343
milestone62.0a1
Bug 1468343 - Part 3: Change tooltip content to address infinity duration. r?jdescottes MozReview-Commit-ID: 4DXXbhGgWF1
devtools/client/inspector/animation-old/components/animation-time-block.js
devtools/client/inspector/animation/components/graph/SummaryGraph.js
devtools/client/locales/en-US/animationinspector.properties
--- a/devtools/client/inspector/animation-old/components/animation-time-block.js
+++ b/devtools/client/inspector/animation-old/components/animation-time-block.js
@@ -236,20 +236,19 @@ AnimationTimeBlock.prototype = {
       text += L10N.getStr("player.animationIterationCountLabel") + " ";
       text += state.iterationCount ||
               L10N.getStr("player.infiniteIterationCountText");
       text += "\n";
     }
 
     // Adding the iteration start.
     if (state.iterationStart !== 0) {
-      const iterationStartTime = state.iterationStart * state.duration / 1000;
       text += L10N.getFormatStr("player.animationIterationStartLabel",
                                 state.iterationStart,
-                                L10N.numberWithDecimals(iterationStartTime, 2));
+                                getTime(state.iterationStart * state.duration));
       text += "\n";
     }
 
     // Adding the easing if it is not "linear".
     if (state.easing && state.easing !== "linear") {
       text += L10N.getStr("player.animationOverallEasingLabel") + " ";
       text += state.easing;
       text += "\n";
--- a/devtools/client/inspector/animation/components/graph/SummaryGraph.js
+++ b/devtools/client/inspector/animation/components/graph/SummaryGraph.js
@@ -52,17 +52,19 @@ class SummaryGraph extends PureComponent
     if (state.delay) {
       text += getStr("player.animationDelayLabel") + " ";
       text += getTime(state.delay);
       text += "\n";
     }
 
     // Adding the duration.
     text += getStr("player.animationDurationLabel") + " ";
-    text += getTime(state.duration);
+    text += state.duration === Infinity
+              ? getStr("player.infiniteDurationText")
+              : getTime(state.duration);
     text += "\n";
 
     // Adding the endDelay.
     if (state.endDelay) {
       text += getStr("player.animationEndDelayLabel") + " ";
       text += getTime(state.endDelay);
       text += "\n";
     }
@@ -71,20 +73,21 @@ class SummaryGraph extends PureComponent
     if (state.iterationCount !== 1) {
       text += getStr("player.animationIterationCountLabel") + " ";
       text += state.iterationCount || getStr("player.infiniteIterationCountText");
       text += "\n";
     }
 
     // Adding the iteration start.
     if (state.iterationStart !== 0) {
-      const iterationStartTime = state.iterationStart * state.duration / 1000;
       text += getFormatStr("player.animationIterationStartLabel",
                            state.iterationStart,
-                           numberWithDecimals(iterationStartTime, 2));
+                           state.duration === Infinity
+                             ? getStr("player.infiniteDurationText")
+                             : getTime(state.iterationStart * state.duration));
       text += "\n";
     }
 
     // Adding the easing if it is not "linear".
     if (state.easing && state.easing !== "linear") {
       text += getStr("player.animationOverallEasingLabel") + " ";
       text += state.easing;
       text += "\n";
--- a/devtools/client/locales/en-US/animationinspector.properties
+++ b/devtools/client/locales/en-US/animationinspector.properties
@@ -73,17 +73,17 @@ player.infiniteIterationCount=&#8734;
 player.infiniteIterationCountText=∞
 
 # LOCALIZATION NOTE (player.animationIterationStartLabel):
 # This string is displayed in a tooltip that appears when hovering over
 # animations in the timeline. It is the label displayed before the animation
 # iterationStart value.
 # %1$S will be replaced by the original iteration start value
 # %2$S will be replaced by the actual time of iteration start
-player.animationIterationStartLabel=Iteration start: %1$S (%2$Ss)
+player.animationIterationStartLabel=Iteration start: %1$S (%2$S)
 
 # LOCALIZATION NOTE (player.animationOverallEasingLabel):
 # This string is displayed in a tooltip that appears when hovering over
 # animations in the timeline. It is the label displayed before the easing
 # that applies to a whole iteration of an animation as opposed to the
 # easing that applies between animation keyframes.
 player.animationOverallEasingLabel=Overall easing: