Bug 393490. When subsuming an interval, we need to merge its beginning into the current interval as well as its end, because it might start before the current interval. r+sr=dbaron
authorroc+@cs.cmu.edu
Thu, 21 Feb 2008 17:02:52 -0800
changeset 12056 2449f72feeb531a0f312b55784c84af54daba396
parent 12055 7cc3a4bd61038a6a2b9869f2261c32ea8a64ab56
child 12057 8353f51ec631fce113eee05c04b45e201a559932
push idunknown
push userunknown
push dateunknown
bugs393490
milestone1.9b4pre
Bug 393490. When subsuming an interval, we need to merge its beginning into the current interval as well as its end, because it might start before the current interval. r+sr=dbaron
layout/generic/nsIntervalSet.cpp
--- a/layout/generic/nsIntervalSet.cpp
+++ b/layout/generic/nsIntervalSet.cpp
@@ -83,16 +83,17 @@ void nsIntervalSet::IncludeInterval(coor
     while (*current && (*current)->mEnd < aBegin)
         current = &(*current)->mNext;
 
     newInterval->mNext = *current;
     *current = newInterval;
 
     Interval *subsumed = newInterval->mNext;
     while (subsumed && subsumed->mBegin <= aEnd) {
+        newInterval->mBegin = PR_MIN(newInterval->mBegin, subsumed->mBegin);
         newInterval->mEnd = PR_MAX(newInterval->mEnd, subsumed->mEnd);
         newInterval->mNext = subsumed->mNext;
         FreeInterval(subsumed);
         subsumed = newInterval->mNext;
     }
 }
 
 PRBool nsIntervalSet::HasPoint(coord_type aPoint) const