diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 0c5e58845829..6513f0419875 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2530,10 +2530,6 @@ ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, nsIAtom* aOri needImageVisibilityUpdate = true; } - if (needImageVisibilityUpdate) { - presContext->PresShell()->ScheduleImageVisibilityUpdate(); - } - // notify the listeners. for (uint32_t i = 0; i < mListeners.Length(); i++) { mListeners[i]->ScrollPositionWillChange(pt.x, pt.y); @@ -2564,9 +2560,17 @@ ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, nsIAtom* aOri if (!displayPort.IsEqualEdges(oldDisplayPort)) { mOuter->SchedulePaint(); + + if (needImageVisibilityUpdate) { + presContext->PresShell()->ScheduleImageVisibilityUpdate(); + } } } else { mOuter->SchedulePaint(); + + if (needImageVisibilityUpdate) { + presContext->PresShell()->ScheduleImageVisibilityUpdate(); + } } if (mOuter->ChildrenHavePerspective()) {