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
Родитель 849c6b1b7a
Коммит 159f2c3ab6
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', // use all the available space. If it's simply a `reflow root',
// then use the target frame's size as the available space. // then use the target frame's size as the available space.
nsSize size; nsSize size;
if (target == rootFrame) if (target == rootFrame) {
size = mPresContext->GetVisibleArea().Size(); 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(); size = target->GetSize();
}
NS_ASSERTION(!target->GetNextInFlow() && !target->GetPrevInFlow(), NS_ASSERTION(!target->GetNextInFlow() && !target->GetPrevInFlow(),
"reflow roots should never split"); "reflow roots should never split");

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

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