Bug 645572 - Don't let the frame constructor's update count to become negative. r=sicking
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 08 Apr 2011 14:29:34 -0700
changeset 67696 0a780111aacb24497319d8404aabff0e9360725d
parent 67695 652bd0eed005369e444005e6a75944a174056f91
child 67697 a780787bc92305695d0995e425ee4b7d01c9200c
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs645572
milestone2.2a1pre
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 645572 - Don't let the frame constructor's update count to become negative. r=sicking
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8299,17 +8299,20 @@ nsCSSFrameConstructor::EndUpdate()
 {
   if (mUpdateCount == 1) {
     // This is the end of our last update.  Before we decrement
     // mUpdateCount, recalc quotes and counters as needed.
 
     RecalcQuotesAndCounters();
     NS_ASSERTION(mUpdateCount == 1, "Odd update count");
   }
-  --mUpdateCount;
+  // Negative update counts don't make sense
+  if (mUpdateCount > 0) {
+    --mUpdateCount;
+  }
 }
 
 void
 nsCSSFrameConstructor::RecalcQuotesAndCounters()
 {
   if (mQuotesDirty) {
     mQuotesDirty = PR_FALSE;
     mQuoteList.RecalcAll();