diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index 925f0ebb77b..8c914a6be17 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -1068,18 +1068,34 @@ NS_IMETHODIMP nsViewManager :: GetViewClipAbsolute(nsIView *aView, nsRect *rect, NS_IMETHODIMP nsViewManager :: SetViewContentTransparency(nsIView *aView, PRBool aTransparent) { - UpdateTransCnt(aView, nsnull); - aView->SetContentTransparency(aTransparent); - UpdateTransCnt(nsnull, aView); + PRBool trans; + + aView->HasTransparency(trans); + + if (trans != aTransparent) + { + UpdateTransCnt(aView, nsnull); + aView->SetContentTransparency(aTransparent); + UpdateTransCnt(nsnull, aView); + UpdateView(aView, nsnull, 0); + } return NS_OK; } NS_IMETHODIMP nsViewManager :: SetViewOpacity(nsIView *aView, float aOpacity) { - UpdateTransCnt(aView, nsnull); - aView->SetOpacity(aOpacity); - UpdateTransCnt(nsnull, aView); + float opacity; + + aView->GetOpacity(opacity); + + if (opacity != aOpacity) + { + UpdateTransCnt(aView, nsnull); + aView->SetOpacity(aOpacity); + UpdateTransCnt(nsnull, aView); + UpdateView(aView, nsnull, 0); + } return NS_OK; }