Bug 1732674 - Assert on tree mutations. r=jfkthame
This should hopefully help catch misuse. Fix an iterator that was living for too long in ScrollIntoView. Differential Revision: https://phabricator.services.mozilla.com/D128855
This commit is contained in:
@@ -3618,17 +3618,19 @@ void PresShell::DoScrollContentIntoView() {
|
||||
bool haveRect = false;
|
||||
bool useWholeLineHeightForInlines = data->mContentScrollVAxis.mWhenToScroll !=
|
||||
WhenToScroll::IfNotFullyVisible;
|
||||
// Reuse the same line iterator across calls to AccumulateFrameBounds. We set
|
||||
// it every time we detect a new block (stored in prevBlock).
|
||||
nsIFrame* prevBlock = nullptr;
|
||||
nsAutoLineIterator lines;
|
||||
// The last line we found a continuation on in |lines|. We assume that later
|
||||
// continuations cannot come on earlier lines.
|
||||
int32_t curLine = 0;
|
||||
do {
|
||||
AccumulateFrameBounds(container, frame, useWholeLineHeightForInlines,
|
||||
frameBounds, haveRect, prevBlock, lines, curLine);
|
||||
} while ((frame = frame->GetNextContinuation()));
|
||||
{
|
||||
nsIFrame* prevBlock = nullptr;
|
||||
// Reuse the same line iterator across calls to AccumulateFrameBounds.
|
||||
// We set it every time we detect a new block (stored in prevBlock).
|
||||
nsAutoLineIterator lines;
|
||||
// The last line we found a continuation on in |lines|. We assume that later
|
||||
// continuations cannot come on earlier lines.
|
||||
int32_t curLine = 0;
|
||||
do {
|
||||
AccumulateFrameBounds(container, frame, useWholeLineHeightForInlines,
|
||||
frameBounds, haveRect, prevBlock, lines, curLine);
|
||||
} while ((frame = frame->GetNextContinuation()));
|
||||
}
|
||||
|
||||
ScrollFrameRectIntoView(container, frameBounds, scrollMargin,
|
||||
data->mContentScrollVAxis, data->mContentScrollHAxis,
|
||||
|
||||
Reference in New Issue
Block a user