Bug 1472859 - Part 1: Avoid crashing which is in case the all values of keyframes are same. r=gl
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 03 Jul 2018 16:22:28 +0900
changeset 424972 f94c634c79d05b14058c5635e434ceb23e68ec42
parent 424971 cdfb7cd94980a0e50b275d076b1ed8f5edc1c797
child 424973 262572362be873bbdd2d90c364eed331c4c57513
push id104946
push userrgurzau@mozilla.com
push dateWed, 04 Jul 2018 10:03:16 +0000
treeherdermozilla-inbound@796893f4d2f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1472859
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1472859 - Part 1: Avoid crashing which is in case the all values of keyframes are same. r=gl MozReview-Commit-ID: Bz60drhwohf
devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js
--- 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) {