Bug 1085050 - Remove a DEBUG assertion. r=kip a=lmandel
authorMats Palmgren <mats@mozilla.com>
Sun, 26 Oct 2014 14:53:00 +0000
changeset 225812 1cd947f5b6d8
parent 225811 4fd0f4651a61
child 225813 043c91e3aaeb
push id4025
push usermpalmgren@mozilla.com
push date2014-10-26 14:53 +0000
treeherdermozilla-beta@1cd947f5b6d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip, lmandel
bugs1085050
milestone34.0
Bug 1085050 - Remove a DEBUG assertion. r=kip a=lmandel
layout/xul/tree/nsTreeBodyFrame.cpp
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -4082,19 +4082,22 @@ nsTreeBodyFrame::ScrollByPages(int32_t a
 }
 
 nsresult
 nsTreeBodyFrame::ScrollInternal(const ScrollParts& aParts, int32_t aRow)
 {
   if (!mView) {
     return NS_OK;
   }
+
+  // Note that we may be "over scrolled" at this point; that is the
+  // current mTopRowIndex may be larger than mRowCount - mPageLength.
+  // This can happen when items are removed for example. (bug 1085050)
+
   int32_t maxTopRowIndex = std::max(0, mRowCount - mPageLength);
-  MOZ_ASSERT(mTopRowIndex == mozilla::clamped(mTopRowIndex, 0, maxTopRowIndex));
-
   aRow = mozilla::clamped(aRow, 0, maxTopRowIndex);
   if (aRow == mTopRowIndex) {
     return NS_OK;
   }
   mTopRowIndex = aRow;
   Invalidate();
   PostScrollEvent();
   return NS_OK;