Bug 564991. Part 42: When the root frame changes size, invalidate the changed area. r=tnikkel

This commit is contained in:
Robert O'Callahan 2010-07-16 09:08:12 +12:00
Родитель f7ac43fd89
Коммит be5f8938fa
2 изменённых файлов: 10 добавлений и 6 удалений

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

@ -7440,10 +7440,16 @@ PresShell::DoReflow(nsIFrame* target, PRBool aInterruptible)
// use all the available space. If it's simply a `reflow root',
// then use the target frame's size as the available space.
nsSize size;
if (target == rootFrame)
if (target == rootFrame) {
size = mPresContext->GetVisibleArea().Size();
else
// target->GetRect() has the old size of the frame,
// mPresContext->GetVisibleArea() has the new size.
target->InvalidateRectDifference(mPresContext->GetVisibleArea(),
target->GetRect());
} else {
size = target->GetSize();
}
NS_ASSERTION(!target->GetNextInFlow() && !target->GetPrevInFlow(),
"reflow roots should never split");

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

@ -3960,17 +3960,15 @@ nsIFrame::InvalidateRoot(const nsRect& aDamageRect, PRUint32 aFlags)
NS_ASSERTION(nsLayoutUtils::GetDisplayRootFrame(this) == this,
"Can only call this on display roots");
nsRect rect;
rect.IntersectRect(aDamageRect, nsRect(nsPoint(0,0), GetSize()));
if ((mState & NS_FRAME_HAS_CONTAINER_LAYER) &&
!(aFlags & INVALIDATE_NO_THEBES_LAYERS)) {
FrameLayerBuilder::InvalidateThebesLayerContents(this, rect);
FrameLayerBuilder::InvalidateThebesLayerContents(this, aDamageRect);
}
PRUint32 flags =
(aFlags & INVALIDATE_IMMEDIATE) ? NS_VMREFRESH_IMMEDIATE : NS_VMREFRESH_NO_SYNC;
nsRect rect = aDamageRect;
nsRegion* excludeRegion = static_cast<nsRegion*>
(Properties().Get(DeferInvalidatesProperty()));
if (excludeRegion) {