Bug 1092626 - Don't try to restore the scroll position if the frame is still dirty or has dirty children. r=roc

This commit is contained in:
Mats Palmgren 2015-11-11 11:33:34 +01:00
Родитель 8dcb8265ce
Коммит eb154663cc
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -4752,9 +4752,15 @@ ScrollFrameHelper::FinishReflowForScrollbar(nsIContent* aContent,
bool
ScrollFrameHelper::ReflowFinished()
{
nsAutoScriptBlocker scriptBlocker;
mPostedReflowCallback = false;
if (NS_SUBTREE_DIRTY(mOuter)) {
// We will get another call after the next reflow and scrolling
// later is less janky.
return false;
}
nsAutoScriptBlocker scriptBlocker;
ScrollToRestoredPosition();
// Clamp current scroll position to new bounds. Normally this won't
@ -4768,9 +4774,9 @@ ScrollFrameHelper::ReflowFinished()
mDestination = GetScrollPosition();
}
if (NS_SUBTREE_DIRTY(mOuter) || !mUpdateScrollbarAttributes)
if (!mUpdateScrollbarAttributes) {
return false;
}
mUpdateScrollbarAttributes = false;
// Update scrollbar attributes.