Bug 1085050 - Remove a DEBUG assertion. r=kip a=lmandel
authorMats Palmgren <mats@mozilla.com>
Sun, 26 Oct 2014 14:50:51 +0000
changeset 234799 9f1722745a1889dd674c3537b168e39ecafe0342
parent 234798 28cbab4bcfc73984aeba273e7f4b085aadf1f053
child 234800 65f38304cc6ea07fe306d22794c43e5aa979a292
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip, lmandel
bugs1085050
milestone35.0a2
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;