Bug 1330538 - Hide easing label in tooltip when the easing is linear (the default); r?daisuke
MozReview-Commit-ID: 4mfeki3OXhR
--- 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'");