Bug 1330538 - Hide easing label in tooltip when the easing is linear (the default); r?daisuke draft
authorBrian Birtles <birtles@gmail.com>
Thu, 09 Feb 2017 16:05:45 +0900
changeset 481085 65a7a14895c94615eb9cf0e0275548697eb548b3
parent 480952 f505911eb333d5ae8c2bf5c44f7b85add6450b53
child 481086 7a20f4416ef2fc1d161820d4834e43d3758a1b11
push id44712
push userbbirtles@mozilla.com
push dateThu, 09 Feb 2017 07:21:35 +0000
reviewersdaisuke
bugs1330538
milestone54.0a1
Bug 1330538 - Hide easing label in tooltip when the easing is linear (the default); r?daisuke MozReview-Commit-ID: 4mfeki3OXhR
devtools/client/animationinspector/components/animation-time-block.js
devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
--- a/devtools/client/animationinspector/components/animation-time-block.js
+++ b/devtools/client/animationinspector/components/animation-time-block.js
@@ -294,18 +294,18 @@ AnimationTimeBlock.prototype = {
     if (state.iterationStart !== 0) {
       let iterationStartTime = state.iterationStart * state.duration / 1000;
       text += L10N.getFormatStr("player.animationIterationStartLabel",
                                 state.iterationStart,
                                 L10N.numberWithDecimals(iterationStartTime, 2));
       text += "\n";
     }
 
-    // Adding the easing.
-    if (state.easing) {
+    // Adding the easing if it is not "linear".
+    if (state.easing && state.easing !== "linear") {
       text += L10N.getStr("player.animationEasingLabel") + " ";
       text += state.easing;
       text += "\n";
     }
 
     // Adding the fill mode.
     if (state.fill) {
       text += L10N.getStr("player.animationFillLabel") + " ";
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
@@ -32,18 +32,21 @@ add_task(function* () {
     if (state.endDelay) {
       ok(title.match(/End delay: [\d.-]+s/), "The tooltip shows the endDelay");
     }
     if (state.iterationCount !== 1) {
       ok(title.match(/Repeats: /), "The tooltip shows the iterations");
     } else {
       ok(!title.match(/Repeats: /), "The tooltip doesn't show the iterations");
     }
-    if (state.easing) {
+    if (state.easing && state.easing !== "linear") {
       ok(title.match(/Easing: /), "The tooltip shows the easing");
+    } else {
+      ok(!title.match(/Easing: /),
+         "The tooltip doesn't show the easing if it is 'linear'");
     }
     if (state.fill) {
       ok(title.match(/Fill: /), "The tooltip shows the fill");
     }
     if (state.direction) {
       if (state.direction === "normal") {
         ok(!title.match(/Direction: /),
           "The tooltip doesn't show the direction if it is 'normal'");