Bug 450322 - Fix broken windows animation in Vista Aero. r+sr=roc.
authorJim Mathies <jmathies@mozilla.com>
Wed, 04 Feb 2009 21:05:48 -0600
changeset 24645 64bebcc65154
parent 24644 6c1090838778
child 24646 e82ee5073a2a
push id5139
push userjmathies@mozilla.com
push dateThu, 05 Feb 2009 03:06:26 +0000
treeherdermozilla-central@64bebcc65154 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs450322
milestone1.9.2a1pre
Bug 450322 - Fix broken windows animation in Vista Aero. r+sr=roc.
layout/base/nsCSSRendering.cpp
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -945,17 +945,17 @@ FindCanvasBackground(nsIFrame* aForFrame
 
     *aBackground = result;
   } else {
     // This should always give transparent, so we'll fill it in with the
     // default color if needed.  This seems to happen a bit while a page is
     // being loaded.
     *aBackground = aForFrame->GetStyleBackground();
   }
-  
+
   return PR_TRUE;
 }
 
 inline PRBool
 FindElementBackground(nsIFrame* aForFrame, nsIFrame* aRootElementFrame,
                       const nsStyleBackground** aBackground)
 {
   if (aForFrame == aRootElementFrame) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3051,16 +3051,25 @@ nsLayoutUtils::GetFrameTransparency(nsIF
     return eTransparencyTransparent;
 
   nsTransparencyMode transparency;
   if (aFrame->IsThemed(&transparency))
     return transparency;
 
   if (aFrame->GetStyleDisplay()->mAppearance == NS_THEME_WIN_GLASS)
     return eTransparencyGlass;
+
+  // We need an uninitialized window to be treated as opaque because
+  // doing otherwise breaks window display effects on some platforms,
+  // specifically Vista. (bug 450322)
+  if (aFrame->GetType() == nsGkAtoms::viewportFrame &&
+      !aFrame->GetFirstChild(nsnull)) {
+    return eTransparencyOpaque;
+  }
+
   PRBool isCanvas;
   const nsStyleBackground* bg;
   if (!nsCSSRendering::FindBackground(aFrame->PresContext(), aFrame, &bg, &isCanvas))
     return eTransparencyTransparent;
   if (NS_GET_A(bg->mBackgroundColor) < 255)
     return eTransparencyTransparent;
   if (bg->mBackgroundClip != NS_STYLE_BG_CLIP_BORDER)
     return eTransparencyTransparent;