Bug 1472859 - Part 1: Avoid crashing which is in case the all values of keyframes are same. r?gl
MozReview-Commit-ID: Bz60drhwohf
--- a/devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js
+++ b/devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js
@@ -28,17 +28,17 @@ class ColorPath extends ComputedStylePat
return "color";
}
getPropertyValue(keyframe) {
return keyframe.value;
}
propToState({ keyframes }) {
- const maxObject = { distance: 0 };
+ const maxObject = { distance: -Number.MAX_VALUE };
for (let i = 0; i < keyframes.length - 1; i++) {
const value1 = getRGBA(keyframes[i].value);
for (let j = i + 1; j < keyframes.length; j++) {
const value2 = getRGBA(keyframes[j].value);
const distance = getRGBADistance(value1, value2);
if (maxObject.distance >= distance) {