Bug 1366371 - Use signed integer for intersection threshold. r=mstange
authorTobias Schneider <schneider@jancona.com>
Wed, 26 Jul 2017 16:00:58 -0700
changeset 422456 173b2aadfbabf2ff7ba10777197487f0b3d722c1
parent 422455 28b09080d79ac444361f5d9f2e3c851ba9ec97f8
child 422457 8486350a848a528bf5262c03a929fcf742d7daff
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1366371
milestone56.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 1366371 - Use signed integer for intersection threshold. r=mstange
dom/base/DOMIntersectionObserver.cpp
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -428,25 +428,25 @@ DOMIntersectionObserver::Update(nsIDocum
 
     double intersectionRatio;
     if (targetArea > 0.0) {
       intersectionRatio = intersectionArea / targetArea;
     } else {
       intersectionRatio = intersectionRect.isSome() ? 1.0 : 0.0;
     }
 
-    size_t threshold = -1;
+    int32_t threshold = -1;
     if (intersectionRatio > 0.0) {
       if (intersectionRatio >= 1.0) {
         intersectionRatio = 1.0;
-        threshold = mThresholds.Length();
+        threshold = (int32_t)mThresholds.Length();
       } else {
         for (size_t k = 0; k < mThresholds.Length(); ++k) {
           if (mThresholds[k] <= intersectionRatio) {
-            threshold = k + 1;
+            threshold = (int32_t)k + 1;
           } else {
             break;
           }
         }
       }
     } else if (intersectionRect.isSome()) {
       threshold = 0;
     }