Bug 1291707 part 4 - Not recalc quotes and counters in EndUpdate. r=bz
It will be called in the next flush, so no need to do it eagerly.
MozReview-Commit-ID: 1B8pzn0dqBO
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1530,17 +1530,19 @@ nsCSSFrameConstructor::nsCSSFrameConstru
: nsFrameManager(aPresShell)
, mDocument(aDocument)
, mRootElementFrame(nullptr)
, mRootElementStyleFrame(nullptr)
, mDocElementContainingBlock(nullptr)
, mGfxScrollFrame(nullptr)
, mPageSequenceFrame(nullptr)
, mCurrentDepth(0)
+#ifdef DEBUG
, mUpdateCount(0)
+#endif
, mQuotesDirty(false)
, mCountersDirty(false)
, mIsDestroyingFrameTree(false)
, mHasRootAbsPosContainingBlock(false)
, mAlwaysCreateFramesForIgnorableWhitespace(false)
{
#ifdef DEBUG
static bool gFirstTime = true;
@@ -8601,31 +8603,28 @@ nsCSSFrameConstructor::BeginUpdate() {
nsRootPresContext* rootPresContext =
mPresShell->GetPresContext()->GetRootPresContext();
if (rootPresContext) {
rootPresContext->IncrementDOMGeneration();
}
++sGlobalGenerationNumber;
+#ifdef DEBUG
++mUpdateCount;
+#endif
}
void
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");
- }
+#ifdef DEBUG
NS_ASSERTION(mUpdateCount, "Negative mUpdateCount!");
--mUpdateCount;
+#endif
}
void
nsCSSFrameConstructor::RecalcQuotesAndCounters()
{
if (mQuotesDirty) {
mQuotesDirty = false;
mQuoteList.RecalcAll();
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -2070,17 +2070,19 @@ private:
// the real "initial containing block" according to CSS 2.1.
nsContainerFrame* mDocElementContainingBlock;
nsIFrame* mGfxScrollFrame;
nsIFrame* mPageSequenceFrame;
nsQuoteList mQuoteList;
nsCounterManager mCounterManager;
// Current ProcessChildren depth.
uint16_t mCurrentDepth;
+#ifdef DEBUG
uint16_t mUpdateCount;
+#endif
bool mQuotesDirty : 1;
bool mCountersDirty : 1;
bool mIsDestroyingFrameTree : 1;
// This is true if mDocElementContainingBlock supports absolute positioning
bool mHasRootAbsPosContainingBlock : 1;
bool mAlwaysCreateFramesForIgnorableWhitespace : 1;
nsCOMPtr<nsILayoutHistoryState> mTempFrameTreeState;