mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 629823 - Use the right view manager for the parent view. r=tnikkel a=roc
This commit is contained in:
parent
0d6b76ad28
commit
125805c748
@ -1327,6 +1327,8 @@ void nsViewManager::InvalidateHorizontalBandDifference(nsView *aView, const nsRe
|
||||
|
||||
void nsViewManager::InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut,
|
||||
PRUint32 aUpdateFlags) {
|
||||
NS_ASSERTION(aView->GetViewManager() == this,
|
||||
"InvalidateRectDifference called on view we don't own");
|
||||
if (aRect.y < aCutOut.y) {
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aUpdateFlags, aRect.y, aCutOut.y, PR_FALSE);
|
||||
}
|
||||
@ -1346,25 +1348,27 @@ NS_IMETHODIMP nsViewManager::ResizeView(nsIView *aView, const nsRect &aRect, PRB
|
||||
|
||||
view->GetDimensions(oldDimensions);
|
||||
if (!oldDimensions.IsExactEqual(aRect)) {
|
||||
nsView* parentView = view->GetParent();
|
||||
if (parentView == nsnull)
|
||||
parentView = view;
|
||||
|
||||
// resize the view.
|
||||
// Prevent Invalidation of hidden views
|
||||
if (view->GetVisibility() == nsViewVisibility_kHide) {
|
||||
view->SetDimensions(aRect, PR_FALSE);
|
||||
} else {
|
||||
nsView* parentView = view->GetParent();
|
||||
if (!parentView) {
|
||||
parentView = view;
|
||||
}
|
||||
nsRect oldBounds = view->GetBoundsInParentUnits();
|
||||
view->SetDimensions(aRect, PR_TRUE);
|
||||
nsViewManager* parentVM = parentView->GetViewManager();
|
||||
if (!aRepaintExposedAreaOnly) {
|
||||
//Invalidate the union of the old and new size
|
||||
UpdateView(view, aRect, NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(parentView, oldBounds, NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->UpdateView(parentView, oldBounds, NS_VMREFRESH_NO_SYNC);
|
||||
} else {
|
||||
InvalidateRectDifference(view, aRect, oldDimensions, NS_VMREFRESH_NO_SYNC);
|
||||
nsRect newBounds = view->GetBoundsInParentUnits();
|
||||
InvalidateRectDifference(parentView, oldBounds, newBounds, NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->InvalidateRectDifference(parentView, oldBounds, newBounds,
|
||||
NS_VMREFRESH_NO_SYNC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user