Merge backout; a=orange
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Oct 2010 14:55:09 +0200
changeset 55861 eb674a183386b262da821e55846e85cd7a6d1476
parent 55860 f64feb757627ef4618bb723b4fde991dd3a4098d (current diff)
parent 55859 1e685d9c9e704d698b80446d1f48df3313864a69 (diff)
child 55862 19b35fde8b4dbaeaad343f131952eb904902c8db
child 59307 c25ad89fe707bb1cb00888b7952ee3c869ab2347
push idunknown
push userunknown
push dateunknown
reviewersorange
milestone2.0b8pre
Merge backout; a=orange
xpfe/appshell/src/nsAbout.cpp
xpfe/appshell/src/nsAbout.h
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -162,17 +162,17 @@ toolbarbutton.chevron:-moz-locale-dir(rt
 
 /* ----- BOOKMARK BUTTONS ----- */
 
 toolbarbutton.bookmark-item {
   font-weight: bold;
   color: #222;
   border: 0;
   border-radius: 10000px;
-  padding: 0 8px;
+  padding: 1px 8px;
   margin: 0 0 1px;
 }
 
 .bookmark-item > .toolbarbutton-menu-dropmarker {
   list-style-image: url("chrome://browser/skin/places/folderDropArrow.png");
   -moz-image-region: rect(0, 7px, 5px, 0);
   margin-top: 1px;
   -moz-margin-start: 3px;
@@ -209,16 +209,18 @@ toolbarbutton.bookmark-item[open="true"]
 toolbarbutton.bookmark-item > menupopup {
   margin-top: 2px;
   -moz-margin-start: 3px;
 }
 
 .bookmark-item > .toolbarbutton-icon {
   width: 16px;
   min-height: 16px;
+  max-height: 16px;
+  padding: 0;
 }
 
 .bookmark-item > .toolbarbutton-icon[label]:not([label=""]),
 .bookmark-item > .toolbarbutton-icon[type="menu"] {
   -moz-margin-end: 5px;
 }
 
 .bookmark-item[container] {
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -5560,18 +5560,18 @@ nsSVGFEImageElement::Filter(nsSVGFilterI
                                       filterSubregion.Width(), filterSubregion.Height(),
                                       0,0, nativeWidth, nativeHeight,
                                       mPreserveAspectRatio);
 
     gfxMatrix xyTM = gfxMatrix().Translate(gfxPoint(filterSubregion.X(), filterSubregion.Y()));
 
     gfxMatrix TM = viewBoxTM * xyTM;
     
-    gfxContext ctx(aTarget->mImage);
-    nsSVGUtils::CompositePatternMatrix(&ctx, thebesPattern, TM, nativeWidth, nativeHeight, 1.0);
+    nsRefPtr<gfxContext> ctx = new gfxContext(aTarget->mImage);
+    nsSVGUtils::CompositePatternMatrix(ctx, thebesPattern, TM, nativeWidth, nativeHeight, 1.0);
   }
 
   return NS_OK;
 }
 
 nsIntRect
 nsSVGFEImageElement::ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
         const nsSVGFilterInstance& aInstance)
--- a/content/svg/content/src/nsSVGPathElement.cpp
+++ b/content/svg/content/src/nsSVGPathElement.cpp
@@ -1037,16 +1037,17 @@ nsSVGPathList::Playback(gfxContext *aCtx
       break;
     }
   }
 }
 
 already_AddRefed<gfxFlattenedPath>
 nsSVGPathList::GetFlattenedPath(const gfxMatrix& aMatrix)
 {
-  gfxContext ctx(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
+  nsRefPtr<gfxContext> ctx =
+    new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
-  ctx.SetMatrix(aMatrix);
-  Playback(&ctx);
-  ctx.IdentityMatrix();
+  ctx->SetMatrix(aMatrix);
+  Playback(ctx);
+  ctx->IdentityMatrix();
 
-  return ctx.GetFlattenedPath();
+  return ctx->GetFlattenedPath();
 }
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -59,16 +59,18 @@ struct RedirEntry {
   URI_SAFE_FOR_UNTRUSTED_CONTENT in the third argument to each map item below
   unless your about: page really needs chrome privileges. Security review is
   required before adding new map entries without
   URI_SAFE_FOR_UNTRUSTED_CONTENT.  Also note, however, that adding
   URI_SAFE_FOR_UNTRUSTED_CONTENT will allow random web sites to link to that
   URI.  Perhaps we should separate the two concepts out...
  */
 static RedirEntry kRedirMap[] = {
+    { "", "chrome://global/content/about.xhtml",
+      nsIAboutModule::ALLOW_SCRIPT },
     { "about", "chrome://global/content/aboutAbout.xhtml", 0 },
     { "credits", "http://www.mozilla.org/credits/",
       nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT },
     { "mozilla", "chrome://global/content/mozilla.xhtml",
       nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT },
     { "plugins", "chrome://global/content/plugins.html", 0 },
     { "config", "chrome://global/content/config.xul", 0 },
 #ifdef MOZ_CRASHREPORTER
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -178,16 +178,17 @@ const mozilla::Module::CIDEntry kDocShel
   { &kNS_DOWNLOADHISTORY_CID, false, NULL, nsDownloadHistoryConstructor },
   { NULL }
 };
 
 const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
   { "@mozilla.org/docshell;1", &kNS_DOCSHELL_CID },
   { NS_URIFIXUP_CONTRACTID, &kNS_DEFAULTURIFIXUP_CID },
   { NS_WEBNAVIGATION_INFO_CONTRACTID, &kNS_WEBNAVIGATION_INFO_CID },
+  { NS_ABOUT_MODULE_CONTRACTID_PREFIX "", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "about", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
 #ifdef MOZ_CRASHREPORTER
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashes", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
 #endif
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "credits", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "mozilla", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -265,19 +265,19 @@ CreateSamplingRestrictedDrawable(gfxDraw
         return nsnull;
 
     gfxIntSize size(PRInt32(needed.Width()), PRInt32(needed.Height()));
     nsRefPtr<gfxASurface> temp =
         gfxPlatform::GetPlatform()->CreateOffscreenSurface(size, gfxASurface::ContentFromFormat(aFormat));
     if (!temp || temp->CairoStatus())
         return nsnull;
 
-    gfxContext tmpCtx(temp);
-    tmpCtx.SetOperator(OptimalFillOperator());
-    aDrawable->Draw(&tmpCtx, needed - needed.pos, PR_TRUE,
+    nsRefPtr<gfxContext> tmpCtx = new gfxContext(temp);
+    tmpCtx->SetOperator(OptimalFillOperator());
+    aDrawable->Draw(tmpCtx, needed - needed.pos, PR_TRUE,
                     gfxPattern::FILTER_FAST, gfxMatrix().Translate(needed.pos));
 
     nsRefPtr<gfxPattern> resultPattern = new gfxPattern(temp);
     if (!resultPattern)
         return nsnull;
 
     nsRefPtr<gfxDrawable> drawable = 
         new gfxSurfaceDrawable(temp, size, gfxMatrix().Translate(-needed.pos));
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -374,18 +374,19 @@ void nsDisplayList::PaintForFrame(nsDisp
 
   nsRefPtr<LayerManager> layerManager;
   if (aFlags & PAINT_USE_WIDGET_LAYERS) {
     nsIFrame* referenceFrame = aBuilder->ReferenceFrame();
     NS_ASSERTION(referenceFrame == nsLayoutUtils::GetDisplayRootFrame(referenceFrame),
                  "Reference frame must be a display root for us to use the layer manager");
     nsIWidget* window = referenceFrame->GetNearestWidget();
     if (window) {
-      layerManager = window->GetLayerManager();
-      if (layerManager) {
+      bool allowRetaining = true;
+      layerManager = window->GetLayerManager(&allowRetaining);
+      if (layerManager && allowRetaining) {
         aBuilder->LayerBuilder()->WillBeginRetainedLayerTransaction(layerManager);
       }
     }
   }
   if (!layerManager) {
     if (!aCtx) {
       NS_WARNING("Nowhere to paint into");
       return;
new file mode 100755
--- /dev/null
+++ b/layout/generic/crashtests/592118.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<title>Stack pointer free with -moz-element</title>
+<div id="paintServer" style="width: 20px; height: 20px; background: red;"></div>
+<div style="-moz-transform: scale(1.01); width: 100px; height: 100px; background: -moz-element(#paintServer) -5px -3px; background-size: 20px 32769px;"></div>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -333,8 +333,9 @@ load 580504-1.xhtml
 load 585598-1.xhtml
 load 586806-1.html
 load 586806-2.html
 load 586806-3.html
 load 586973-1.html
 load 589002-1.html
 load 590404.html
 load 591141.html
+asserts(0-1) load 592118.html
--- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
@@ -165,33 +165,34 @@ nsSVGPathGeometryFrame::GetFrameForPoint
     if (!mask || (!(mask & HITTEST_MASK_FORCE_TEST) &&
                   !mRect.Contains(aPoint)))
       return nsnull;
     fillRule = GetStyleSVG()->mFillRule;
   }
 
   PRBool isHit = PR_FALSE;
 
-  gfxContext context(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
+  nsRefPtr<gfxContext> context =
+    new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
-  GeneratePath(&context);
+  GeneratePath(context);
   gfxPoint userSpacePoint =
-    context.DeviceToUser(gfxPoint(PresContext()->AppUnitsToGfxUnits(aPoint.x),
-                                  PresContext()->AppUnitsToGfxUnits(aPoint.y)));
+    context->DeviceToUser(gfxPoint(PresContext()->AppUnitsToGfxUnits(aPoint.x),
+                                   PresContext()->AppUnitsToGfxUnits(aPoint.y)));
 
   if (fillRule == NS_STYLE_FILL_RULE_EVENODD)
-    context.SetFillRule(gfxContext::FILL_RULE_EVEN_ODD);
+    context->SetFillRule(gfxContext::FILL_RULE_EVEN_ODD);
   else
-    context.SetFillRule(gfxContext::FILL_RULE_WINDING);
+    context->SetFillRule(gfxContext::FILL_RULE_WINDING);
 
   if (mask & HITTEST_MASK_FILL)
-    isHit = context.PointInFill(userSpacePoint);
+    isHit = context->PointInFill(userSpacePoint);
   if (!isHit && (mask & HITTEST_MASK_STROKE)) {
-    SetupCairoStrokeHitGeometry(&context);
-    isHit = context.PointInStroke(userSpacePoint);
+    SetupCairoStrokeHitGeometry(context);
+    isHit = context->PointInStroke(userSpacePoint);
   }
 
   if (isHit && nsSVGUtils::HitTestClip(this, aPoint))
     return this;
 
   return nsnull;
 }
 
@@ -245,42 +246,43 @@ nsSVGPathGeometryFrame::GetCoveredRegion
   return mRect;
 }
 
 NS_IMETHODIMP
 nsSVGPathGeometryFrame::UpdateCoveredRegion()
 {
   mRect.Empty();
 
-  gfxContext context(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
+  nsRefPtr<gfxContext> context =
+    new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
-  GeneratePath(&context);
-  context.IdentityMatrix();
+  GeneratePath(context);
+  context->IdentityMatrix();
 
-  gfxRect extent = context.GetUserPathExtent();
+  gfxRect extent = context->GetUserPathExtent();
 
   // Be careful when replacing the following logic to get the fill and stroke
   // extents independently (instead of computing the stroke extents from the
   // path extents). You may think that you can just use the stroke extents if
   // there is both a fill and a stroke. In reality it's necessary to calculate
   // both the fill and stroke extents, and take the union of the two. There are
   // two reasons for this:
   //
   // # Due to stroke dashing, in certain cases the fill extents could actually
   //   extend outside the stroke extents.
   // # If the stroke is very thin, cairo won't paint any stroke, and so the
   //   stroke bounds that it will return will be empty.
 
   if (HasStroke()) {
-    SetupCairoStrokeGeometry(&context);
+    SetupCairoStrokeGeometry(context);
     if (extent.Width() <= 0 && extent.Height() <= 0) {
       // If 'extent' is empty, its position will not be set. Although
       // GetUserStrokeExtent gets the extents wrong we can still use it
       // to get the device space position of zero length stroked paths.
-      extent = context.GetUserStrokeExtent();
+      extent = context->GetUserStrokeExtent();
       extent.pos.x += extent.size.width / 2;
       extent.pos.y += extent.size.height / 2;
       extent.size.width = 0;
       extent.size.height = 0;
     }
     extent = nsSVGUtils::PathExtentsToMaxStrokeExtents(extent, this);
   } else if (GetStyleSVG()->mFill.mType == eStyleSVGPaintType_None) {
     extent = gfxRect(0, 0, 0, 0);
@@ -357,20 +359,21 @@ nsSVGPathGeometryFrame::GetMatrixPropaga
 
 gfxRect
 nsSVGPathGeometryFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace)
 {
   if (aToBBoxUserspace.IsSingular()) {
     // XXX ReportToConsole
     return gfxRect(0.0, 0.0, 0.0, 0.0);
   }
-  gfxContext context(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
-  GeneratePath(&context, &aToBBoxUserspace);
-  context.IdentityMatrix();
-  return context.GetUserPathExtent();
+  nsRefPtr<gfxContext> context =
+    new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
+  GeneratePath(context, &aToBBoxUserspace);
+  context->IdentityMatrix();
+  return context->GetUserPathExtent();
 }
 
 //----------------------------------------------------------------------
 // nsSVGGeometryFrame methods:
 
 gfxMatrix
 nsSVGPathGeometryFrame::GetCanvasTM()
 {
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -93,25 +93,16 @@ LightweightThemeConsumer.prototype = {
       _setImage(footer, active, aData.footerURL);
       if (active && aData.footerURL)
         footer.setAttribute("lwthemefooter", "true");
       else
         footer.removeAttribute("lwthemefooter");
     }
 
 #ifdef XP_MACOSX
-
-    if (active && aData.accentcolor) {
-      root.setAttribute("activetitlebarcolor", aData.accentcolor);
-      root.setAttribute("inactivetitlebarcolor", aData.accentcolor);
-    } else {
-      root.removeAttribute("activetitlebarcolor");
-      root.removeAttribute("inactivetitlebarcolor");
-    }
-
     if (active)
       root.setAttribute("drawintitlebar", "true");
     else
       root.removeAttribute("drawintitlebar");
 #endif
   }
 }
 
--- a/toolkit/content/about.xhtml
+++ b/toolkit/content/about.xhtml
@@ -63,19 +63,17 @@
       <img src="about:logo" alt="&brandShortName;"/>
 #expand <p id="version">&about.version; __MOZ_APP_VERSION__</p>
     </a>
   </div>
 
   <ul id="aboutPageList">
     <li>&about.credits.beforeLink;<a href="about:credits">&about.credits.linkTitle;</a>&about.credits.afterLink;</li>
     <li>&about.license.beforeTheLink;<a href="about:license">&about.license.linkTitle;</a>&about.license.afterTheLink;</li>
-    <!-- Release notes link removed pending fix for bug 349985
     <li>&about.relnotes.beforeTheLink;<a id="releaseNotesURL" href="">&about.relnotes.linkTitle;</a>&about.relnotes.afterTheLink;</li>
-    -->
     <li>&about.buildconfig.beforeTheLink;<a href="about:buildconfig">&about.buildconfig.linkTitle;</a>&about.buildconfig.afterTheLink;</li>
     <script type="application/javascript">
       // get release notes URL from prefs
       try {
         var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
                                   .getService(Components.interfaces.nsIURLFormatter);
         var releaseNotesURL = formatter.formatURLPref("app.releaseNotesURL");
         var relnotes = document.getElementById("releaseNotesURL");
--- a/toolkit/themes/gnomestripe/global/numberbox.css
+++ b/toolkit/themes/gnomestripe/global/numberbox.css
@@ -51,17 +51,16 @@ textbox[type="number"] {
 
 html|*.numberbox-input {
   text-align: right;
 }
 
 .numberbox-input-box {
   -moz-box-align: center;
   -moz-appearance: spinner-textfield;
-  cursor: text;
   margin-right: -1px;
   border: 2px solid;
   -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
   -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
   -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
   -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
   padding: 3px;
 }
--- a/toolkit/themes/pinstripe/global/numberbox.css
+++ b/toolkit/themes/pinstripe/global/numberbox.css
@@ -47,20 +47,18 @@ textbox[type="number"] {
 }
 
 html|*.numberbox-input {
   text-align: right;
 }
 
 .numberbox-input-box {
   -moz-appearance: textfield;
-  cursor: text;
   margin-right: 4px;
   border: 3px solid;
   -moz-border-top-colors: transparent #888888 #000000;
   -moz-border-right-colors: transparent #FFFFFF #000000;
   -moz-border-bottom-colors: transparent #FFFFFF #000000;
   -moz-border-left-colors: transparent #888888 #000000;
   border-top-right-radius: 2px;
   border-bottom-left-radius: 2px;
   background-color: -moz-Field;
-  color: -moz-FieldText;
 }
--- a/widget/public/nsIWidget.h
+++ b/widget/public/nsIWidget.h
@@ -112,20 +112,20 @@ typedef nsEventStatus (* EVENT_CALLBACK)
 #define NS_NATIVE_PLUGIN_PORT_CG    101
 #endif
 #ifdef XP_WIN
 #define NS_NATIVE_TSF_THREAD_MGR       100
 #define NS_NATIVE_TSF_CATEGORY_MGR     101
 #define NS_NATIVE_TSF_DISPLAY_ATTR_MGR 102
 #endif
 
-// 8bd36c8c-8218-4859-bfbc-ca5d78b52f7d
+// cc443f0b-af39-415d-9c4b-7e06eaa8b13b
 #define NS_IWIDGET_IID \
-  { 0x8bd36c8c, 0x8218, 0x4859, \
-    { 0xbf, 0xbc, 0xca, 0x5d, 0x78, 0xb5, 0x2f, 0x7d } }
+  { 0xcc443f0b, 0xaf39, 0x415d, \
+    { 0x9c, 0x4b, 0x7e, 0x06, 0xea, 0xa8, 0xb1, 0x3b } }
 
 /*
  * Window shadow styles
  * Also used for the -moz-window-shadow CSS property
  */
 
 #define NS_STYLE_WINDOW_SHADOW_NONE             0
 #define NS_STYLE_WINDOW_SHADOW_DEFAULT          1
@@ -850,20 +850,21 @@ class nsIWidget : public nsISupports {
      * @return the toolkit this widget was created in. See nsToolkit.
      */
 
     virtual nsIToolkit* GetToolkit() = 0;    
 
     /**
      * Return the widget's LayerManager. The layer tree for that
      * LayerManager is what gets rendered to the widget.
-     * The layer manager is guaranteed to be the same for the lifetime
-     * of the widget.
+     *
+     * @param aAllowRetaining an outparam that states whether the returned
+     * layer manager should be used for retained layers
      */
-    virtual LayerManager* GetLayerManager() = 0;
+    virtual LayerManager* GetLayerManager(bool* aAllowRetaining = nsnull) = 0;
 
     /** 
      * Internal methods
      */
 
     //@{
     virtual void AddChild(nsIWidget* aChild) = 0;
     virtual void RemoveChild(nsIWidget* aChild) = 0;
--- a/widget/src/android/nsWindow.cpp
+++ b/widget/src/android/nsWindow.cpp
@@ -587,18 +587,21 @@ nsWindow::DispatchEvent(nsGUIEvent *aEve
 
 NS_IMETHODIMP
 nsWindow::SetWindowClass(const nsAString& xulWinType)
 {
     return NS_OK;
 }
 
 mozilla::layers::LayerManager*
-nsWindow::GetLayerManager()
+nsWindow::GetLayerManager(bool* aAllowRetaining)
 {
+    if (aAllowRetaining) {
+        *aAllowRetaining = true;
+    }
     if (mLayerManager) {
         return mLayerManager;
     }
 
     printf_stderr("nsWindow::GetLayerManager\n");
 
     nsWindow *topWindow = TopWindow();
 
--- a/widget/src/android/nsWindow.h
+++ b/widget/src/android/nsWindow.h
@@ -157,17 +157,17 @@ public:
     NS_IMETHOD GetIMEEnabled(PRUint32* aState);
     NS_IMETHOD CancelIMEComposition();
 
     NS_IMETHOD OnIMEFocusChange(PRBool aFocus);
     NS_IMETHOD OnIMETextChange(PRUint32 aStart, PRUint32 aOldEnd, PRUint32 aNewEnd);
     NS_IMETHOD OnIMESelectionChange(void);
     virtual nsIMEUpdatePreference GetIMEUpdatePreference();
 
-    LayerManager* GetLayerManager();
+    LayerManager* GetLayerManager(bool* aAllowRetaining = nsnull);
     gfxASurface* GetThebesSurface();
 
     NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
 protected:
     void BringToFront();
     nsWindow *FindTopLevel();
     PRBool DrawTo(gfxASurface *targetSurface);
     PRBool IsTopLevel();
--- a/widget/src/cocoa/nsChildView.h
+++ b/widget/src/cocoa/nsChildView.h
@@ -206,35 +206,33 @@ extern "C" long TSMProcessRawKeyEvent(Ev
 
 // Stop NSView hierarchy being changed during [ChildView drawRect:]
 - (void)delayedTearDown;
 
 - (void)sendFocusEvent:(PRUint32)eventType;
 
 - (void)handleMouseMoved:(NSEvent*)aEvent;
 
-- (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext;
+- (void)drawRect:(NSRect)aRect inTitlebarContext:(CGContextRef)aContext;
 
 - (void)sendMouseEnterOrExitEvent:(NSEvent*)aEvent
                             enter:(BOOL)aEnter
                              type:(nsMouseEvent::exitType)aType;
 
 #ifndef NP_NO_CARBON
 - (void) processPluginKeyEvent:(EventRef)aKeyEvent;
 #endif
 - (void)pluginRequestsComplexTextInputForCurrentEvent;
 
 - (void)update;
 - (void)lockFocus;
 - (void) _surfaceNeedsUpdate:(NSNotification*)notification;
 
 - (BOOL)isPluginView;
 
-- (BOOL)isUsingOpenGL;
-
 // Simple gestures support
 //
 // XXX - The swipeWithEvent, beginGestureWithEvent, magnifyWithEvent,
 // rotateWithEvent, and endGestureWithEvent methods are part of a
 // PRIVATE interface exported by nsResponder and reverse-engineering
 // was necessary to obtain the methods' prototypes. Thus, Apple may
 // change the interface in the future without notice.
 //
--- a/widget/src/cocoa/nsChildView.mm
+++ b/widget/src/cocoa/nsChildView.mm
@@ -112,16 +112,17 @@ extern "C" {
   CG_EXTERN void CGContextResetClip(CGContextRef);
 
   // CGSPrivate.h
   typedef NSInteger CGSConnection;
   typedef NSInteger CGSWindow;
   extern CGSConnection _CGSDefaultConnection();
   extern CGError CGSGetScreenRectForWindow(const CGSConnection cid, CGSWindow wid, CGRect *outRect);
   extern CGError CGSGetWindowLevel(const CGSConnection cid, CGSWindow wid, CGWindowLevel *level);
+  extern CGError CGSGetWindowAlpha(const CGSConnection cid, const CGSWindow wid, float* alpha);
 }
 
 // defined in nsMenuBarX.mm
 extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
 
 // these are defined in nsCocoaWindow.mm
 extern PRBool gConsumeRollupEvent;
 
@@ -186,16 +187,18 @@ PRUint32 nsChildView::sLastInputEventCou
 
 - (void)maybeInitContextMenuTracking;
 
 + (NSEvent*)makeNewCocoaEventWithType:(NSEventType)type fromEvent:(NSEvent*)theEvent;
 
 - (float)beginMaybeResetUnifiedToolbar;
 - (void)endMaybeResetUnifiedToolbar:(float)aOldHeight;
 
+- (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext;
+
 #if USE_CLICK_HOLD_CONTEXTMENU
  // called on a timer two seconds after a mouse down to see if we should display
  // a context menu (click-hold)
 - (void)clickHoldCallback:(id)inEvent;
 #endif
 
 #ifdef ACCESSIBILITY
 - (id<mozAccessible>)accessible;
@@ -2592,21 +2595,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
   }
 }
 
 - (void) _surfaceNeedsUpdate:(NSNotification*)notification
 {
    [self update];
 }
 
-- (BOOL) isUsingOpenGL
-{
-    return mGeckoChild && mGeckoChild->GetLayerManager()->GetBackendType() == LayerManager::LAYERS_OPENGL;
-}
-
 // The display system has told us that a portion of our view is dirty. Tell
 // gecko to paint it
 - (void)drawRect:(NSRect)aRect
 {
   float oldHeight = [self beginMaybeResetUnifiedToolbar];
 
   CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
   [self drawRect:aRect inContext:cgContext];
@@ -2615,16 +2613,24 @@ NSEvent* gLastDragMouseDownEvent = nil;
   // to make sure the shadow is updated to the new contents.
   if ([[self window] isKindOfClass:[BaseWindow class]]) {
     [(BaseWindow*)[self window] deferredInvalidateShadow];
   }
 
   [self endMaybeResetUnifiedToolbar:oldHeight];
 }
 
+- (void)drawRect:(NSRect)aRect inTitlebarContext:(CGContextRef)aContext
+{
+  // Title bar drawing only works if we really draw into aContext, which only
+  // the basic layer manager will do.
+  nsBaseWidget::AutoUseBasicLayerManager setupLayerManager(mGeckoChild);
+  [self drawRect:aRect inContext:aContext];
+}
+
 - (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext
 {
   PRBool isVisible;
   if (!mGeckoChild || NS_FAILED(mGeckoChild->IsVisible(isVisible)) ||
       !isVisible)
     return;
 
 #ifndef NP_NO_QUICKDRAW
@@ -2649,29 +2655,31 @@ NSEvent* gLastDragMouseDownEvent = nil;
            geckoBounds.x, geckoBounds.y, geckoBounds.width, geckoBounds.height);
 
   CGAffineTransform xform = CGContextGetCTM(aContext);
   fprintf (stderr, "  xform in: [%f %f %f %f %f %f]\n", xform.a, xform.b, xform.c, xform.d, xform.tx, xform.ty);
 #endif
   // Create the event so we can fill in its region
   nsPaintEvent paintEvent(PR_TRUE, NS_PAINT, mGeckoChild);
 
+  nsIntRect boundingRect =
+    nsIntRect(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
   const NSRect *rects;
   NSInteger count, i;
   [[NSView focusView] getRectsBeingDrawn:&rects count:&count];
   if (count < MAX_RECTS_IN_REGION) {
     for (i = 0; i < count; ++i) {
       // Add the rect to the region.
       const NSRect& r = [self convertRect:rects[i] fromView:[NSView focusView]];
       paintEvent.region.Or(paintEvent.region,
         nsIntRect(r.origin.x, r.origin.y, r.size.width, r.size.height));
     }
+    paintEvent.region.And(paintEvent.region, boundingRect);
   } else {
-    paintEvent.region =
-      nsIntRect(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
+    paintEvent.region = boundingRect;
   }
 
 #ifndef NP_NO_QUICKDRAW
   // Subtract quickdraw plugin rectangles from the region
   NSArray* subviews = [self subviews];
   for (int i = 0; i < int([subviews count]); ++i) {
     NSView* view = [subviews objectAtIndex:i];
     if (![view isKindOfClass:[ChildView class]] || [view isHidden])
@@ -6315,16 +6323,22 @@ static BOOL WindowNumberIsUnderPoint(NSI
   // Some things put transparent windows on top of everything. Ignore them.
   CGWindowLevel level;
   if ((kCGErrorSuccess == CGSGetWindowLevel(cid, aWindowNumber, &level)) &&
       (level == kDockWindowLevel ||     // Transparent layer, spanning the whole screen
        level == kFloatingWindowLevel || // invisible Jing window
        level > kPopupWindowLevel))      // Snapz Pro X while recording a screencast
     return false;
 
+  // Ignore transparent windows.
+  float alpha;
+  if ((kCGErrorSuccess == CGSGetWindowAlpha(cid, aWindowNumber, &alpha)) &&
+      alpha < 0.1f)
+    return false;
+
   CGRect rect;
   if (kCGErrorSuccess != CGSGetScreenRectForWindow(cid, aWindowNumber, &rect))
     return false;
 
   CGPoint point = { aPoint.x, nsCocoaUtils::FlippedScreenY(aPoint.y) };
   return CGRectContainsPoint(rect, point);
 }
 
--- a/widget/src/cocoa/nsCocoaWindow.h
+++ b/widget/src/cocoa/nsCocoaWindow.h
@@ -249,17 +249,17 @@ public:
     NS_IMETHOD              SetCursor(nsCursor aCursor);
     NS_IMETHOD              SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY);
 
     NS_IMETHOD              SetTitle(const nsAString& aTitle);
 
     NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous);
     NS_IMETHOD Update();
     virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
-    virtual LayerManager* GetLayerManager();
+    virtual LayerManager* GetLayerManager(bool* aAllowRetaining = nsnull);
     NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ;
     NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, nsIMenuRollup * aMenuRollup,
                                    PRBool aDoCapture, PRBool aConsumeRollupEvent);
     NS_IMETHOD GetAttention(PRInt32 aCycleCount);
     virtual PRBool HasPendingInputEvent();
     virtual nsTransparencyMode GetTransparencyMode();
     virtual void SetTransparencyMode(nsTransparencyMode aMode);
     NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle);
--- a/widget/src/cocoa/nsCocoaWindow.mm
+++ b/widget/src/cocoa/nsCocoaWindow.mm
@@ -927,20 +927,20 @@ nsCocoaWindow::ConfigureChildren(const n
 {
   if (mPopupContentView) {
     mPopupContentView->ConfigureChildren(aConfigurations);
   }
   return NS_OK;
 }
 
 LayerManager*
-nsCocoaWindow::GetLayerManager()
+nsCocoaWindow::GetLayerManager(bool* aAllowRetaining)
 {
   if (mPopupContentView) {
-    return mPopupContentView->GetLayerManager();
+    return mPopupContentView->GetLayerManager(aAllowRetaining);
   }
   return nsnull;
 }
 
 nsTransparencyMode nsCocoaWindow::GetTransparencyMode()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
 
@@ -2430,41 +2430,34 @@ ContentPatternDrawCallback(void* aInfo, 
   // Gecko drawing assumes flippedness, but the current context isn't flipped
   // (because we're painting into the window's border view, which is not a
   // ChildView, so it isn't flpped).
   // So we need to set a flip transform.
   CGContextScaleCTM(aContext, 1.0f, -1.0f);
   CGContextTranslateCTM(aContext, 0.0f, -[window frame].size.height);
 
   NSRect titlebarRect = NSMakeRect(0, 0, [window frame].size.width, [window titlebarHeight]);
-  [(ChildView*)view drawRect:titlebarRect inContext:aContext];
+  [(ChildView*)view drawRect:titlebarRect inTitlebarContext:aContext];
 }
 
 - (void)setFill
 {
-  CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
-  CGPatternDrawPatternCallback cb;
-  float patternWidth;
-  NSView* view = [[[mWindow contentView] subviews] lastObject];
-  if (view && [view isKindOfClass:[ChildView class]] && [(ChildView*)view isUsingOpenGL]) {
-    cb = &RepeatedPatternDrawCallback;
-    patternWidth = sPatternWidth;
-  } else {
-    cb = [mWindow drawsContentsIntoWindowFrame] ?
+  CGPatternDrawPatternCallback cb = [mWindow drawsContentsIntoWindowFrame] ?
                                       &ContentPatternDrawCallback : &RepeatedPatternDrawCallback;
-    patternWidth = [mWindow drawsContentsIntoWindowFrame] ? [mWindow frame].size.width : sPatternWidth;
-  }
+  float patternWidth = [mWindow drawsContentsIntoWindowFrame] ? [mWindow frame].size.width : sPatternWidth;
+
   CGPatternCallbacks callbacks = {0, cb, NULL};
   CGPatternRef pattern = CGPatternCreate(mWindow, CGRectMake(0.0f, 0.0f, patternWidth, [mWindow frame].size.height), 
                                          CGAffineTransformIdentity, patternWidth, [mWindow frame].size.height,
                                          kCGPatternTilingConstantSpacing, true, &callbacks);
 
   // Set the pattern as the fill, which is what we were asked to do. All our
   // drawing will take place in the patternDraw callback.
   CGColorSpaceRef patternSpace = CGColorSpaceCreatePattern(NULL);
+  CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
   CGContextSetFillColorSpace(context, patternSpace);
   CGColorSpaceRelease(patternSpace);
   CGFloat component = 1.0f;
   CGContextSetFillPattern(context, pattern, &component);
   CGPatternRelease(pattern);
 }
 
 - (void)set
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -3175,18 +3175,22 @@ nsWindow::HasPendingInputEvent()
  *
  * SECTION: nsIWidget::GetLayerManager
  *
  * Get the layer manager associated with this widget.
  *
  **************************************************************/
 
 mozilla::layers::LayerManager*
-nsWindow::GetLayerManager()
-{
+nsWindow::GetLayerManager(bool* aAllowRetaining)
+{
+  if (aAllowRetaining) {
+    *aAllowRetaining = true;
+  }
+
 #ifndef WINCE
   if (!mLayerManager) {
     nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
     PRBool accelerateByDefault = PR_TRUE;
     PRBool disableAcceleration = PR_FALSE;
     PRBool preferOpenGL = PR_FALSE;
     PRBool useD3D10 = PR_FALSE;
--- a/widget/src/windows/nsWindow.h
+++ b/widget/src/windows/nsWindow.h
@@ -161,17 +161,17 @@ public:
   virtual nsIntSize       ClientToWindowSize(const nsIntSize& aClientSize);
   NS_IMETHOD              DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
   NS_IMETHOD              EnableDragDrop(PRBool aEnable);
   NS_IMETHOD              CaptureMouse(PRBool aCapture);
   NS_IMETHOD              CaptureRollupEvents(nsIRollupListener * aListener, nsIMenuRollup * aMenuRollup,
                                               PRBool aDoCapture, PRBool aConsumeRollupEvent);
   NS_IMETHOD              GetAttention(PRInt32 aCycleCount);
   virtual PRBool          HasPendingInputEvent();
-  virtual LayerManager*   GetLayerManager();
+  virtual LayerManager*   GetLayerManager(bool* aAllowRetaining = nsnull);
   gfxASurface             *GetThebesSurface();
   NS_IMETHOD              OnDefaultButtonLoaded(const nsIntRect &aButtonRect);
   NS_IMETHOD              OverrideSystemMouseScrollSpeed(PRInt32 aOriginalDelta, PRBool aIsHorizontal, PRInt32 &aOverriddenDelta);
 
   virtual nsresult        SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout,
                                                    PRInt32 aNativeKeyCode,
                                                    PRUint32 aModifierFlags,
                                                    const nsAString& aCharacters,
--- a/widget/src/xpwidgets/PuppetWidget.cpp
+++ b/widget/src/xpwidgets/PuppetWidget.cpp
@@ -305,21 +305,24 @@ PuppetWidget::DispatchEvent(nsGUIEvent* 
     event->widget = mChild;
     mChild->DispatchEvent(event, aStatus);
   }
 
   return NS_OK;
 }
 
 LayerManager*
-PuppetWidget::GetLayerManager()
+PuppetWidget::GetLayerManager(bool* aAllowRetaining)
 {
   if (!mLayerManager) {
     mLayerManager = new BasicShadowLayerManager(this);
   }
+  if (aAllowRetaining) {
+    *aAllowRetaining = true;
+  }
   return mLayerManager;
 }
 
 gfxASurface*
 PuppetWidget::GetThebesSurface()
 {
   return mSurface;
 }
--- a/widget/src/xpwidgets/PuppetWidget.h
+++ b/widget/src/xpwidgets/PuppetWidget.h
@@ -159,17 +159,17 @@ public:
                                  PRBool aDoCapture, PRBool aConsumeRollupEvent)
   { return NS_ERROR_UNEXPECTED; }
 
   //
   // nsBaseWidget methods we override
   //
 
 //NS_IMETHOD              CaptureMouse(PRBool aCapture);
-  virtual LayerManager*     GetLayerManager();
+  virtual LayerManager*     GetLayerManager(bool* aAllowRetaining = nsnull);
 //  virtual nsIDeviceContext* GetDeviceContext();
   virtual gfxASurface*      GetThebesSurface();
 
   NS_IMETHOD ResetInputState();
   NS_IMETHOD SetIMEOpenState(PRBool aState);
   NS_IMETHOD GetIMEOpenState(PRBool *aState);
   NS_IMETHOD SetIMEEnabled(PRUint32 aState);
   NS_IMETHOD GetIMEEnabled(PRUint32 *aState);
--- a/widget/src/xpwidgets/nsBaseWidget.cpp
+++ b/widget/src/xpwidgets/nsBaseWidget.cpp
@@ -101,16 +101,17 @@ nsBaseWidget::nsBaseWidget()
 , mViewCallback(nsnull)
 , mContext(nsnull)
 , mToolkit(nsnull)
 , mCursor(eCursor_standard)
 , mWindowType(eWindowType_child)
 , mBorderStyle(eBorderStyle_none)
 , mOnDestroyCalled(PR_FALSE)
 , mUseAcceleratedRendering(PR_FALSE)
+, mTemporarilyUseBasicLayerManager(PR_FALSE)
 , mBounds(0,0,0,0)
 , mOriginalBounds(nsnull)
 , mClipRectCount(0)
 , mZIndex(0)
 , mSizeMode(nsSizeMode_Normal)
 , mPopupLevel(ePopupLevelTop)
 {
 #ifdef NOISY_WIDGET_LEAKS
@@ -756,16 +757,27 @@ nsBaseWidget::AutoLayerManagerSetup::~Au
     static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
   if (manager) {
     NS_ASSERTION(manager->GetBackendType() == LayerManager::LAYERS_BASIC,
       "AutoLayerManagerSetup instantiated for non-basic layer backend!");
     manager->SetDefaultTarget(nsnull, BasicLayerManager::BUFFER_NONE);
   }
 }
 
+nsBaseWidget::AutoUseBasicLayerManager::AutoUseBasicLayerManager(nsBaseWidget* aWidget)
+  : mWidget(aWidget)
+{
+  mWidget->mTemporarilyUseBasicLayerManager = PR_TRUE;
+}
+
+nsBaseWidget::AutoUseBasicLayerManager::~AutoUseBasicLayerManager()
+{
+  mWidget->mTemporarilyUseBasicLayerManager = PR_FALSE;
+}
+
 PRBool
 nsBaseWidget::GetShouldAccelerate()
 {
   nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
   PRBool disableAcceleration = PR_FALSE;
   PRBool accelerateByDefault = PR_TRUE;
 
@@ -789,17 +801,17 @@ nsBaseWidget::GetShouldAccelerate()
     return PR_FALSE;
 
   if (accelerateByDefault)
     return PR_TRUE;
 
   return mUseAcceleratedRendering;
 }
 
-LayerManager* nsBaseWidget::GetLayerManager()
+LayerManager* nsBaseWidget::GetLayerManager(bool* aAllowRetaining)
 {
   if (!mLayerManager) {
     nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
     mUseAcceleratedRendering = GetShouldAccelerate();
 
     if (mUseAcceleratedRendering) {
       nsRefPtr<LayerManagerOGL> layerManager =
@@ -811,20 +823,28 @@ LayerManager* nsBaseWidget::GetLayerMana
        * platforms on LayerManagerOGL should ensure their widget is able to
        * deal with it though!
        */
       if (layerManager->Initialize()) {
         mLayerManager = layerManager;
       }
     }
     if (!mLayerManager) {
-      mLayerManager = CreateBasicLayerManager();
+      mBasicLayerManager = mLayerManager = CreateBasicLayerManager();
     }
   }
-  return mLayerManager;
+  if (mTemporarilyUseBasicLayerManager && !mBasicLayerManager) {
+    mBasicLayerManager = CreateBasicLayerManager();
+  }
+  LayerManager* usedLayerManager = mTemporarilyUseBasicLayerManager ?
+                                     mBasicLayerManager : mLayerManager;
+  if (aAllowRetaining) {
+    *aAllowRetaining = (usedLayerManager == mLayerManager);
+  }
+  return usedLayerManager;
 }
 
 BasicLayerManager* nsBaseWidget::CreateBasicLayerManager()
 {
 #if !defined(MOZ_IPC)
       return new BasicLayerManager(this);
 #else
       return new BasicShadowLayerManager(this);
--- a/widget/src/xpwidgets/nsBaseWidget.h
+++ b/widget/src/xpwidgets/nsBaseWidget.h
@@ -110,17 +110,17 @@ public:
   virtual nsTransparencyMode GetTransparencyMode();
   virtual void            GetWindowClipRegion(nsTArray<nsIntRect>* aRects);
   NS_IMETHOD              SetWindowShadowStyle(PRInt32 aStyle);
   virtual void            SetShowsToolbarButton(PRBool aShow) {}
   NS_IMETHOD              HideWindowChrome(PRBool aShouldHide);
   NS_IMETHOD              MakeFullScreen(PRBool aFullScreen);
   virtual nsIDeviceContext* GetDeviceContext();
   virtual nsIToolkit*     GetToolkit();
-  virtual LayerManager*   GetLayerManager();
+  virtual LayerManager*   GetLayerManager(bool* aAllowRetaining = nsnull);
   virtual gfxASurface*    GetThebesSurface();
   NS_IMETHOD              SetModal(PRBool aModal); 
   NS_IMETHOD              SetWindowClass(const nsAString& xulWinType);
   NS_IMETHOD              SetBounds(const nsIntRect &aRect);
   NS_IMETHOD              GetBounds(nsIntRect &aRect);
   NS_IMETHOD              GetClientBounds(nsIntRect &aRect);
   NS_IMETHOD              GetScreenBounds(nsIntRect &aRect);
   virtual nsIntPoint      GetClientOffset();
@@ -197,16 +197,25 @@ public:
     AutoLayerManagerSetup(nsBaseWidget* aWidget, gfxContext* aTarget,
                           BasicLayerManager::BufferMode aDoubleBuffering);
     ~AutoLayerManagerSetup();
   private:
     nsBaseWidget* mWidget;
   };
   friend class AutoLayerManagerSetup;
 
+  class AutoUseBasicLayerManager {
+  public:
+    AutoUseBasicLayerManager(nsBaseWidget* aWidget);
+    ~AutoUseBasicLayerManager();
+  private:
+    nsBaseWidget* mWidget;
+  };
+  friend class AutoUseBasicLayerManager;
+
 protected:
 
   virtual void            ResolveIconName(const nsAString &aIconName,
                                           const nsAString &aIconSuffix,
                                           nsILocalFile **aResult);
   virtual void            OnDestroy();
   virtual void            BaseCreate(nsIWidget *aParent,
                                      const nsIntRect &aRect,
@@ -250,23 +259,25 @@ protected:
 protected: 
   void*             mClientData;
   ViewWrapper*      mViewWrapperPtr;
   EVENT_CALLBACK    mEventCallback;
   EVENT_CALLBACK    mViewCallback;
   nsIDeviceContext* mContext;
   nsIToolkit*       mToolkit;
   nsRefPtr<LayerManager> mLayerManager;
+  nsRefPtr<LayerManager> mBasicLayerManager;
   nscolor           mBackground;
   nscolor           mForeground;
   nsCursor          mCursor;
   nsWindowType      mWindowType;
   nsBorderStyle     mBorderStyle;
   PRPackedBool      mOnDestroyCalled;
   PRPackedBool      mUseAcceleratedRendering;
+  PRPackedBool      mTemporarilyUseBasicLayerManager;
   nsIntRect         mBounds;
   nsIntRect*        mOriginalBounds;
   // When this pointer is null, the widget is not clipped
   nsAutoArrayPtr<nsIntRect> mClipRects;
   PRUint32          mClipRectCount;
   PRInt32           mZIndex;
   nsSizeMode        mSizeMode;
   nsPopupLevel      mPopupLevel;
--- a/xpfe/appshell/src/Makefile.in
+++ b/xpfe/appshell/src/Makefile.in
@@ -55,17 +55,16 @@ LIBXUL_LIBRARY	= 1
 CPPSRCS		= \
 		nsChromeTreeOwner.cpp \
 		nsContentTreeOwner.cpp \
 		nsXULWindow.cpp \
 		nsAppShellService.cpp \
 		nsAppShellWindowEnumerator.cpp \
 		nsWebShellWindow.cpp \
 		nsWindowMediator.cpp \
-		nsAbout.cpp \
 		nsAppShellFactory.cpp \
 		$(NULL)
 
 ifeq (,$(filter-out WINCE WINNT,$(OS_ARCH)))
 EXTRA_DSO_LIBS	= gkgfx
 endif
 
 EXTRA_DSO_LDOPTS = \
deleted file mode 100644
--- a/xpfe/appshell/src/nsAbout.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsAbout.h"
-#include "nsIIOService.h"
-#include "nsIServiceManager.h"
-#include "nsIChannel.h"
-#include "nsCOMPtr.h"
-#include "nsIURI.h"
-#include "nsNetCID.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsLiteralString.h"
-
-NS_IMPL_ISUPPORTS1(nsAbout, nsIAboutModule)
-
-static const char kURI[] = "chrome://global/content/about.xhtml";
-
-NS_IMETHODIMP
-nsAbout::NewChannel(nsIURI *aURI, nsIChannel **result)
-{
-    nsresult rv;
-    nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIChannel> tempChannel;
-    rv = ioService->NewChannel(NS_LITERAL_CSTRING(kURI), nsnull, nsnull, 
-                               getter_AddRefs(tempChannel));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIScriptSecurityManager> securityManager = 
-             do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIPrincipal> principal;
-    rv = securityManager->GetCodebasePrincipal(aURI, getter_AddRefs(principal));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsISupports> owner = do_QueryInterface(principal);
-    rv = tempChannel->SetOwner(owner);
-    *result = tempChannel.get();
-    NS_ADDREF(*result);
-    return rv;
-}
-
-NS_IMETHODIMP
-nsAbout::GetURIFlags(nsIURI *aURI, PRUint32 *result)
-{
-    *result = nsIAboutModule::ALLOW_SCRIPT;
-    return NS_OK;
-}
deleted file mode 100644
--- a/xpfe/appshell/src/nsAbout.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsAbout_h_
-#define nsAbout_h_
-
-#include "nsIAboutModule.h"
-
-#define NS_ABOUT_CID                                                           \
-{ /* {1f1ce501-663a-11d3-b7a0-be426e4e69bc} */                                 \
-0x1f1ce501, 0x663a, 0x11d3, { 0xb7, 0xa0, 0xbe, 0x42, 0x6e, 0x4e, 0x69, 0xbc } \
-}
-
-class nsAbout : public nsIAboutModule
-{
-public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIABOUTMODULE
-
-    nsAbout() {}
-    virtual ~nsAbout() {}
-};
-
-#endif // nsAbout_h_
--- a/xpfe/appshell/src/nsAppShellFactory.cpp
+++ b/xpfe/appshell/src/nsAppShellFactory.cpp
@@ -33,43 +33,38 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozilla/ModuleUtils.h"
 #include "nscore.h"
 #include "nsIWindowMediator.h"
-#include "nsAbout.h"
 
 #include "nsIAppShellService.h"
 #include "nsAppShellService.h"
 #include "nsWindowMediator.h"
 #include "nsChromeTreeOwner.h"
 #include "nsAppShellCID.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbout)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init)
 
 NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID);
-NS_DEFINE_NAMED_CID(NS_ABOUT_CID);
 
 static const mozilla::Module::CIDEntry kAppShellCIDs[] = {
   { &kNS_APPSHELLSERVICE_CID, false, NULL, nsAppShellServiceConstructor },
   { &kNS_WINDOWMEDIATOR_CID, false, NULL, nsWindowMediatorConstructor },
-  { &kNS_ABOUT_CID, false, NULL, nsAboutConstructor },
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kAppShellContracts[] = {
   { NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID },
   { NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID },
-  { NS_ABOUT_MODULE_CONTRACTID_PREFIX, &kNS_ABOUT_CID },
   { NULL }
 };
 
 static nsresult
 nsAppShellModuleConstructor()
 {
   return nsChromeTreeOwner::InitGlobals();
 }