Merge forward! Things are looking good!
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 10 Jun 2008 15:02:52 -0400
changeset 125 ed7d306bd129b107164a8121618c28e7a64d68d0
parent 124 0f6daec64ecb954b82b5a550327242837700329f
child 126 e40ba022b1fa24d2b032c85f3c64ea5a1c23bdd5
push id12
push userbsmedberg@mozilla.com
push dateTue, 10 Jun 2008 19:10:56 +0000
Merge forward! Things are looking good!
gfx-refcounting
registration-order-test-fixup
remove-cyclec2
root-atoms
root-atoms2
series
shell-loginit
static-check-gc-attributes
system-metrics-comarray
--- a/gfx-refcounting
+++ b/gfx-refcounting
@@ -29,17 +29,17 @@ diff --git a/content/canvas/src/nsCanvas
  #include "gfxTextRunCache.h"
  
  #include "nsFrameManager.h"
 +
 +using namespace mozilla;
  
  #ifndef M_PI
  #define M_PI		3.14159265358979323846
-@@ -344,15 +346,15 @@ protected:
+@@ -346,15 +348,15 @@ protected:
      nsCOMPtr<nsICSSParser> mCSSParser;
  
      // yay cairo
 -    nsRefPtr<gfxContext> mThebesContext;
 -    nsRefPtr<gfxASurface> mThebesSurface;
 +    RefPtr<gfxContext> mThebesContext;
 +    RefPtr<gfxASurface> mThebesSurface;
  
@@ -48,74 +48,74 @@ diff --git a/content/canvas/src/nsCanvas
      cairo_surface_t *mSurface;
  
      nsString mTextStyle;
 -    nsRefPtr<gfxFontGroup> mFontGroup;
 +    RefPtr<gfxFontGroup> mFontGroup;
      gfxFontGroup *GetCurrentFontStyle();
   
      // style handling
-@@ -746,7 +748,7 @@ nsCanvasRenderingContext2D::Render(gfxCo
+@@ -771,7 +773,7 @@ nsCanvasRenderingContext2D::Render(gfxCo
      if (!mThebesSurface)
          return NS_ERROR_FAILURE;
  
 -    nsRefPtr<gfxPattern> pat = new gfxPattern(mThebesSurface);
 +    RefPtr<gfxPattern> pat = new gfxPattern(mThebesSurface);
  
-     // XXX I don't want to use PixelSnapped here, but layout doesn't guarantee
-     // pixel alignment for this stuff!
-@@ -1651,7 +1653,7 @@ nsCanvasRenderingContext2D::MozTextAlong
+     gfxContext::GraphicsOperator op = ctx->CurrentOperator();
+     if (mOpaque)
+@@ -1683,7 +1685,7 @@ nsCanvasRenderingContext2D::MozTextAlong
  nsCanvasRenderingContext2D::MozTextAlongPath(const nsAString& textToDraw, PRBool stroke)
  {
      // Most of this code is copied from its svg equivalent
 -    nsRefPtr<gfxFlattenedPath> path(mThebesContext->GetFlattenedPath());
 +    RefPtr<gfxFlattenedPath> path(mThebesContext->GetFlattenedPath());
  
      const PRUnichar* textdata;
      textToDraw.GetData(&textdata);
-@@ -2204,7 +2206,7 @@ nsCanvasRenderingContext2D::CairoSurface
+@@ -2236,7 +2238,7 @@ nsCanvasRenderingContext2D::CairoSurface
              rv = canvas->GetSize(&w, &h);
              NS_ENSURE_SUCCESS(rv, rv);
  
 -            nsRefPtr<gfxASurface> sourceSurface;
 +            RefPtr<gfxASurface> sourceSurface;
  
              if (!forceCopy && canvas->CountContexts() == 1) {
                  nsICanvasRenderingContextInternal *srcCanvas = canvas->GetContextAtIndex(0);
-@@ -2214,10 +2216,10 @@ nsCanvasRenderingContext2D::CairoSurface
+@@ -2246,10 +2248,10 @@ nsCanvasRenderingContext2D::CairoSurface
              }
  
              if (sourceSurface == nsnull) {
 -                nsRefPtr<gfxASurface> surf =
 +                RefPtr<gfxASurface> surf =
                      gfxPlatform::GetPlatform()->CreateOffscreenSurface
                      (gfxIntSize(w, h), gfxASurface::ImageFormatARGB32);
 -                nsRefPtr<gfxContext> ctx = new gfxContext(surf);
 +                RefPtr<gfxContext> ctx = new gfxContext(surf);
  
                  // we have to clear first, since some platform surfaces (X11, I'm
                  // looking at you) don't follow the cleared-surface convention.
-@@ -2266,13 +2268,13 @@ nsCanvasRenderingContext2D::CairoSurface
+@@ -2298,13 +2300,13 @@ nsCanvasRenderingContext2D::CairoSurface
      if (heightOut)
          *heightOut = imgHeight;
  
 -    nsRefPtr<gfxPattern> gfxpattern;
 +    RefPtr<gfxPattern> gfxpattern;
      img->GetPattern(getter_AddRefs(gfxpattern));
 -    nsRefPtr<gfxASurface> gfxsurf = gfxpattern->GetSurface();
 +    RefPtr<gfxASurface> gfxsurf = gfxpattern->GetSurface();
  
      if (!gfxsurf) {
          gfxsurf = new gfxImageSurface (gfxIntSize(imgWidth, imgHeight), gfxASurface::ImageFormatARGB32);
 -        nsRefPtr<gfxContext> ctx = new gfxContext(gfxsurf);
 +        RefPtr<gfxContext> ctx = new gfxContext(gfxsurf);
  
          ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
          ctx->SetPattern(gfxpattern);
-@@ -2672,9 +2674,7 @@ nsCanvasRenderingContext2D::GetThebesSur
+@@ -2704,9 +2706,7 @@ nsCanvasRenderingContext2D::GetThebesSur
          return NS_ERROR_NOT_AVAILABLE;
      }
  
 -    *surface = mThebesSurface.get();
 -    NS_ADDREF(*surface);
 -
 +    *surface = do_AddRef(mThebesSurface).get();
      return NS_OK;
@@ -357,17 +357,17 @@ diff --git a/gfx/src/thebes/nsThebesDevi
  #else
  #error Need to declare gSystemFonts!
  #endif
 +
 +using namespace mozilla;
  
  #ifdef MOZ_ENABLE_GTK2
  extern "C" {
-@@ -303,7 +305,7 @@ nsThebesDeviceContext::CreateRenderingCo
+@@ -309,7 +311,7 @@ nsThebesDeviceContext::CreateRenderingCo
      nsCOMPtr<nsIRenderingContext> pContext;
      rv = CreateRenderingContextInstance(*getter_AddRefs(pContext));
      if (NS_SUCCEEDED(rv)) {
 -        nsRefPtr<gfxASurface> surface(aWidget->GetThebesSurface());
 +        RefPtr<gfxASurface> surface(aWidget->GetThebesSurface());
          if (surface)
              rv = pContext->Init(this, surface);
          else
@@ -1623,39 +1623,39 @@ diff --git a/gfx/thebes/src/gfxImageSurf
 +
 +#include <string.h>
  
  gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format) :
      mSize(size), mFormat(format)
 diff --git a/gfx/thebes/src/gfxOS2Fonts.cpp b/gfx/thebes/src/gfxOS2Fonts.cpp
 --- a/gfx/thebes/src/gfxOS2Fonts.cpp
 +++ b/gfx/thebes/src/gfxOS2Fonts.cpp
-@@ -397,10 +397,10 @@ PRBool gfxOS2Font::SetupCairoFont(gfxCon
+@@ -424,10 +424,10 @@ PRBool gfxOS2Font::SetupCairoFont(gfxCon
   * In either case, add a ref and return it ---
   * except for OOM in which case we do nothing and return null.
   */
 -static already_AddRefed<gfxOS2Font> GetOrMakeFont(const nsAString& aName,
 +static AddRefed<gfxOS2Font> GetOrMakeFont(const nsAString& aName,
                                                    const gfxFontStyle *aStyle)
  {
 -    nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(aName, aStyle);
 +    RefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(aName, aStyle);
      if (!font) {
          font = new gfxOS2Font(aName, aStyle);
          if (!font)
-@@ -450,7 +450,7 @@ gfxOS2FontGroup::gfxOS2FontGroup(const n
+@@ -477,7 +477,7 @@ gfxOS2FontGroup::gfxOS2FontGroup(const n
      }
  
      for (int i = 0; i < familyArray.Count(); i++) {
 -        nsRefPtr<gfxOS2Font> font = GetOrMakeFont(*familyArray[i], &mStyle);
 +        RefPtr<gfxOS2Font> font = GetOrMakeFont(*familyArray[i], &mStyle);
          if (font) {
              mFonts.AppendElement(font);
          }
-@@ -479,7 +479,7 @@ gfxOS2FontGroup::gfxOS2FontGroup(const n
+@@ -506,7 +506,7 @@ gfxOS2FontGroup::gfxOS2FontGroup(const n
          for (int i = 3; i < fontList.Count(); i++) {
              // check for duplicates that we already found through the familyArray
              if (familyArray.IndexOf(*fontList[i]) == -1) {
 -                nsRefPtr<gfxOS2Font> font = GetOrMakeFont(*fontList[i], &mStyle);
 +                RefPtr<gfxOS2Font> font = GetOrMakeFont(*fontList[i], &mStyle);
                  if (font) {
                      mFonts.AppendElement(font);
                  }
@@ -2259,189 +2259,180 @@ diff --git a/gfx/thebes/src/gfxWindowsFo
      PRUint32 len = fonts.Length();
      for (PRUint32 i = 0; i < len; ++i) {
          const nsString& str = fonts[i];
 -        nsRefPtr<FontEntry> fe = gfxWindowsPlatform::GetPlatform()->FindFontEntry(str, mStyle);
 +        RefPtr<FontEntry> fe = gfxWindowsPlatform::GetPlatform()->FindFontEntry(str, mStyle);
          list->AppendElement(fe);
      }
  }
-@@ -840,7 +838,7 @@ gfxWindowsFontGroup::gfxWindowsFontGroup
-             NS_ERROR("Failed to create font group");
-             return;
-         }
--        nsRefPtr<FontEntry> fe = gfxWindowsPlatform::GetPlatform()->FindFontEntry(nsDependentString(logFont.lfFaceName), *aStyle);
-+        RefPtr<FontEntry> fe = gfxWindowsPlatform::GetPlatform()->FindFontEntry(nsDependentString(logFont.lfFaceName), *aStyle);
-         mFontEntries.AppendElement(fe);
-         // Keep length of mFonts in sync with length of mFontEntries.
-         // Maybe we should eagerly set up mFonts[0] like we do above,
-@@ -872,7 +870,7 @@ gfxWindowsFontGroup::GetFontAt(PRInt32 i
+@@ -885,7 +883,7 @@ gfxWindowsFontGroup::GetFontAt(PRInt32 i
  gfxWindowsFontGroup::GetFontAt(PRInt32 i)
  {
      if (!mFonts[i]) {
 -        nsRefPtr<gfxWindowsFont> font =
 +        RefPtr<gfxWindowsFont> font =
              gfxWindowsFont::GetOrMakeFont(mFontEntries[i], &mStyle);
          mFonts[i] = font;
      }
-@@ -1055,7 +1053,7 @@ gfxWindowsFontGroup::InitTextRunGDI(gfxC
+@@ -1068,7 +1066,7 @@ gfxWindowsFontGroup::InitTextRunGDI(gfxC
  gfxWindowsFontGroup::InitTextRunGDI(gfxContext *aContext, gfxTextRun *aRun,
                                      const char *aString, PRUint32 aLength)
  {
 -    nsRefPtr<gfxWindowsFont> font = GetFontAt(0);
 +    RefPtr<gfxWindowsFont> font = GetFontAt(0);
      DCFromContext dc(aContext);
      if (SetupDCFont(dc, font)) {
          nsAutoTArray<WCHAR,500> glyphArray;
-@@ -1079,7 +1077,7 @@ gfxWindowsFontGroup::InitTextRunGDI(gfxC
+@@ -1092,7 +1090,7 @@ gfxWindowsFontGroup::InitTextRunGDI(gfxC
  gfxWindowsFontGroup::InitTextRunGDI(gfxContext *aContext, gfxTextRun *aRun,
                                      const PRUnichar *aString, PRUint32 aLength)
  {
 -    nsRefPtr<gfxWindowsFont> font = GetFontAt(0);
 +    RefPtr<gfxWindowsFont> font = GetFontAt(0);
      DCFromContext dc(aContext);
      if (SetupDCFont(dc, font)) {
          nsAutoTArray<WCHAR,500> glyphArray;
-@@ -1595,12 +1593,12 @@ public:
+@@ -1608,12 +1606,12 @@ public:
      struct TextRange {
          TextRange(PRUint32 aStart,  PRUint32 aEnd) : start(aStart), end(aEnd) { }
          PRUint32 Length() const { return end - start; }
 -        nsRefPtr<gfxWindowsFont> font;
 +        RefPtr<gfxWindowsFont> font;
          PRUint32 start, end;
      };
  
      void SetRange(PRUint32 i) {
 -        nsRefPtr<gfxWindowsFont> font;
 +        RefPtr<gfxWindowsFont> font;
          if (mRanges[i].font)
              font = mRanges[i].font;
          else
-@@ -1620,7 +1618,7 @@ public:
+@@ -1633,7 +1631,7 @@ public:
              if (ch > 0xFFFF)
                  return PR_FALSE;
  
 -            nsRefPtr<gfxWindowsFont> font =
 +            RefPtr<gfxWindowsFont> font =
                  gfxWindowsFont::GetOrMakeFont(aFontEntry, mGroup->GetStyle());
              if (!font->IsValid())
                  return PR_FALSE;
-@@ -1658,10 +1656,10 @@ public:
+@@ -1671,10 +1669,10 @@ public:
          return PR_FALSE;
      }
  
 -    inline already_AddRefed<gfxWindowsFont>
 -    WhichFontSupportsChar(const nsTArray<nsRefPtr<FontEntry> >& fonts, PRUint32 ch) {
 +    inline AddRefed<gfxWindowsFont>
 +    WhichFontSupportsChar(const nsTArray<RefPtr<FontEntry> >& fonts, PRUint32 ch) {
          for (PRUint32 i = 0; i < fonts.Length(); i++) {
 -            nsRefPtr<FontEntry> fe = fonts[i];
 +            RefPtr<FontEntry> fe = fonts[i];
              if (fe->mSymbolFont && !mGroup->GetStyle()->familyNameQuirks)
                  continue;
              if (HasCharacter(fe, ch)) {
-@@ -1682,10 +1680,10 @@ public:
+@@ -1695,10 +1693,10 @@ public:
                  ch == 0x2060);
      }
  
 -    inline already_AddRefed<gfxWindowsFont>
 +    inline AddRefed<gfxWindowsFont>
      FindFontForChar(PRUint32 ch, PRUint32 prevCh, PRUint32 nextCh,
                      gfxWindowsFont *aFont) {
 -        nsRefPtr<gfxWindowsFont> selectedFont;
 +        RefPtr<gfxWindowsFont> selectedFont;
  
          // if this character or the next one is a joiner use the
          // same font as the previous range if we can
-@@ -1721,7 +1719,7 @@ public:
+@@ -1734,7 +1732,7 @@ public:
                  if (langGroup) {
                      PR_LOG(gFontLog, PR_LOG_DEBUG, (" - Trying to find fonts for: %s (%s)", langGroup, gScriptToText[primaryId].value));
  
 -                    nsAutoTArray<nsRefPtr<FontEntry>, 5> fonts;
 +                    nsAutoTArray<RefPtr<FontEntry>, 5> fonts;
                      this->GetPrefFonts(langGroup, fonts);
                      selectedFont = WhichFontSupportsChar(fonts, ch);
                  }
-@@ -1733,7 +1731,7 @@ public:
+@@ -1746,7 +1744,7 @@ public:
                      if (PR_LOG_TEST(gFontLog, PR_LOG_DEBUG))
                          PR_LOG(gFontLog, PR_LOG_DEBUG, (" - Trying to find fonts for: CJK"));
  
 -                    nsAutoTArray<nsRefPtr<FontEntry>, 15> fonts;
 +                    nsAutoTArray<RefPtr<FontEntry>, 15> fonts;
                      this->GetCJKPrefFonts(fonts);
                      selectedFont = WhichFontSupportsChar(fonts, ch);
                  } else {
-@@ -1741,7 +1739,7 @@ public:
+@@ -1754,7 +1752,7 @@ public:
                      if (langGroup) {
                          PR_LOG(gFontLog, PR_LOG_DEBUG, (" - Trying to find fonts for: %s", langGroup));
  
 -                        nsAutoTArray<nsRefPtr<FontEntry>, 5> fonts;
 +                        nsAutoTArray<RefPtr<FontEntry>, 5> fonts;
                          this->GetPrefFonts(langGroup, fonts);
                          selectedFont = WhichFontSupportsChar(fonts, ch);
                      }
-@@ -1757,7 +1755,7 @@ public:
+@@ -1770,7 +1768,7 @@ public:
          if (!selectedFont) {
              PR_LOG(gFontLog, PR_LOG_DEBUG, (" - Looking for best match"));
  
 -            nsRefPtr<gfxWindowsFont> refFont = mGroup->GetFontAt(0);
 +            RefPtr<gfxWindowsFont> refFont = mGroup->GetFontAt(0);
              gfxWindowsPlatform *platform = gfxWindowsPlatform::GetPlatform();
              selectedFont = platform->FindFontForChar(ch, refFont);
          }
-@@ -1787,7 +1785,7 @@ public:
+@@ -1800,7 +1798,7 @@ public:
                  if ((i+2 < mItemLength) && NS_IS_HIGH_SURROGATE(nextCh) && NS_IS_LOW_SURROGATE(mItemString[i+2]))
                      nextCh = SURROGATE_TO_UCS4(nextCh, mItemString[i+2]);
              }
 -            nsRefPtr<gfxWindowsFont> font =
 +            RefPtr<gfxWindowsFont> font =
                  FindFontForChar(ch,
                                  prevCh,
                                  nextCh,
-@@ -1835,10 +1833,10 @@ private:
+@@ -1848,10 +1846,10 @@ private:
      }
  
      // this function appends to the array passed in.
 -    void GetPrefFonts(const char *aLangGroup, nsTArray<nsRefPtr<FontEntry> >& array) {
 +    void GetPrefFonts(const char *aLangGroup, nsTArray<RefPtr<FontEntry> >& array) {
          NS_ASSERTION(aLangGroup, "aLangGroup is null");
          gfxWindowsPlatform *platform = gfxWindowsPlatform::GetPlatform();
 -        nsAutoTArray<nsRefPtr<FontEntry>, 5> fonts;
 +        nsAutoTArray<RefPtr<FontEntry>, 5> fonts;
          /* this lookup has to depend on weight and style */
          nsCAutoString key(aLangGroup);
          key.Append("-");
-@@ -1860,7 +1858,7 @@ private:
+@@ -1873,7 +1871,7 @@ private:
      }
  
      // this function assigns to the array passed in.
 -    void GetCJKPrefFonts(nsTArray<nsRefPtr<FontEntry> >& array) {
 +    void GetCJKPrefFonts(nsTArray<RefPtr<FontEntry> >& array) {
          gfxWindowsPlatform *platform = gfxWindowsPlatform::GetPlatform();
  
          nsCAutoString key("x-internal-cjk-");
-@@ -1947,7 +1945,7 @@ private:
+@@ -1960,7 +1958,7 @@ private:
      }
  
  private:
 -    nsRefPtr<gfxContext> mContext;
 +    RefPtr<gfxContext> mContext;
      HDC mDC;
  
      SCRIPT_ITEM *mScriptItem;
-@@ -1979,7 +1977,7 @@ private:
+@@ -1992,7 +1990,7 @@ private:
      int mMaxGlyphs;
      int mNumGlyphs;
  
 -    nsRefPtr<gfxWindowsFont> mCurrentFont;
 +    RefPtr<gfxWindowsFont> mCurrentFont;
  
      PRPackedBool mFontSelected;
  
-@@ -2139,7 +2137,7 @@ public:
+@@ -2152,7 +2150,7 @@ public:
      }
  
  private:
 -    nsRefPtr<gfxContext> mContext;
 +    RefPtr<gfxContext> mContext;
      HDC mDC;
      const PRUnichar *mString;
      const PRUint32 mLength;
@@ -2856,62 +2847,26 @@ diff --git a/gfx/thebes/test/gfxWordCach
 -       nsRefPtr<gfxFontGroup> fontGroup =
 +       RefPtr<gfxFontGroup> fontGroup =
             gfxPlatform::GetPlatform()->CreateFontGroup(NS_LITERAL_STRING("Geneva, MS Sans Serif, Helvetica,serif"), &style);
  
         gfxTextRunFactory::Parameters params = {
 diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp
 --- a/layout/base/nsCSSRendering.cpp
 +++ b/layout/base/nsCSSRendering.cpp
-@@ -72,6 +72,8 @@
+@@ -74,6 +74,8 @@
  
  #include "gfxContext.h"
  
 +using namespace mozilla;
 +
  #define BORDER_FULL    0        //entire side
  #define BORDER_INSIDE  1        //inside half
  #define BORDER_OUTSIDE 2        //outside half
-@@ -2803,7 +2805,7 @@ nsCSSRendering::PaintBorder(nsPresContex
-   SF(" borderStyles: %d %d %d %d\n", borderStyles[0], borderStyles[1], borderStyles[2], borderStyles[3]);
- 
-   // start drawing
--  nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
- 
-   ctx->Save();
- 
-@@ -2961,7 +2963,7 @@ nsCSSRendering::PaintOutline(nsPresConte
-                                 width / twipsPerPixel };
- 
-   // start drawing
--  nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
- 
-   ctx->Save();
- 
-@@ -3705,7 +3707,7 @@ nsCSSRendering::PaintBackgroundWithSC(ns
-     anchor.y += bgClipArea.y - aBorderArea.y;
-   }
- 
--  nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-   ctx->Save();
- 
-   nscoord appUnitsPerPixel = aPresContext->DevPixelsToAppUnits(1);
-@@ -3999,7 +4001,7 @@ nsCSSRendering::PaintRoundedBackground(n
-                                        nscoord aTheRadius[4],
-                                        PRBool aCanPaintNonWhite)
- {
--  nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
- 
-   // needed for our border thickness
-   nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
-@@ -4472,7 +4474,7 @@ nsCSSRendering::PaintDecorationLine(gfxC
+@@ -4562,7 +4564,7 @@ nsCSSRendering::PaintDecorationLine(gfxC
    PRBool contextIsSaved = PR_FALSE;
  
    gfxFloat oldLineWidth;
 -  nsRefPtr<gfxPattern> oldPattern;
 +  RefPtr<gfxPattern> oldPattern;
  
    switch (aStyle) {
      case NS_STYLE_BORDER_STYLE_SOLID:
@@ -2982,25 +2937,16 @@ diff --git a/layout/base/nsLayoutUtils.c
  #include "nsSVGForeignObjectFrame.h"
  #include "nsSVGOuterSVGFrame.h"
  #endif
 +
 +using namespace mozilla;
  
  /**
   * A namespace class for static layout utilities.
-@@ -2513,7 +2515,7 @@ nsLayoutUtils::DrawImage(nsIRenderingCon
-   nsCOMPtr<nsIDeviceContext> dc;
-   aRenderingContext->GetDeviceContext(*getter_AddRefs(dc));
- 
--  nsRefPtr<gfxContext> ctx = aRenderingContext->ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext->ThebesContext();
- 
-   // the dest rect is affected by the current transform; that'll be
-   // handled by Image::Draw(), when we actually set up the rectangle.
 diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
 --- a/layout/base/nsPresShell.cpp
 +++ b/layout/base/nsPresShell.cpp
 @@ -204,6 +204,8 @@ static NS_DEFINE_CID(kCSSStyleSheetCID, 
  static NS_DEFINE_CID(kCSSStyleSheetCID, NS_CSS_STYLESHEET_CID);
  static NS_DEFINE_IID(kRangeCID,     NS_RANGE_CID);
  
 +using namespace mozilla;
@@ -3153,79 +3099,43 @@ diff --git a/layout/generic/nsBlockFrame
  #ifdef DEBUG
  #include "nsPrintfCString.h"
  #include "nsBlockDebugFlags.h"
 +
 +using namespace mozilla;
  
  PRBool nsBlockFrame::gLamePaintMetrics;
  PRBool nsBlockFrame::gLameReflowMetrics;
-@@ -5916,7 +5918,7 @@ nsBlockFrame::PaintTextDecorationLine(ns
-       
-   // Only paint if we have a positive width
-   if (width > 0) {
--    nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+    RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-     gfxPoint pt(PresContext()->AppUnitsToGfxUnits(start + aPt.x),
-                 PresContext()->AppUnitsToGfxUnits(aLine->mBounds.y + aPt.y));
-     gfxSize size(PresContext()->AppUnitsToGfxUnits(width), aSize);
 diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
 --- a/layout/generic/nsFrame.cpp
 +++ b/layout/generic/nsFrame.cpp
-@@ -122,6 +122,8 @@
+@@ -121,6 +121,8 @@
+ #include "nsDisplayList.h"
  
  #include "gfxContext.h"
- 
++
 +using namespace mozilla;
-+
+ 
  static NS_DEFINE_CID(kLookAndFeelCID,  NS_LOOKANDFEEL_CID);
  static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
- 
-@@ -784,7 +786,7 @@ void nsDisplaySelectionOverlay::Paint(ns
-   gfxRGBA c(color);
-   c.a = .5;
- 
--  nsRefPtr<gfxContext> ctx = aCtx->ThebesContext();
-+  RefPtr<gfxContext> ctx = aCtx->ThebesContext();
-   ctx->SetColor(c);
- 
-   nsRect rect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
 diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp
 --- a/layout/generic/nsHTMLContainerFrame.cpp
 +++ b/layout/generic/nsHTMLContainerFrame.cpp
 @@ -71,6 +71,8 @@
  #include "nsLineBox.h"
  #include "nsDisplayList.h"
  #include "nsCSSRendering.h"
 +
 +using namespace mozilla;
  
  class nsDisplayTextDecoration : public nsDisplayItem {
  public:
-@@ -239,7 +241,7 @@ nsHTMLContainerFrame::PaintTextDecoratio
-     }
-   }
-   nscoord innerWidth = mRect.width - bp.left - bp.right;
--  nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+  RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-   gfxPoint pt(PresContext()->AppUnitsToGfxUnits(bp.left + aPt.x),
-               PresContext()->AppUnitsToGfxUnits(bp.top + aPt.y));
-   gfxSize size(PresContext()->AppUnitsToGfxUnits(innerWidth), aSize);
 diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp
 --- a/layout/generic/nsObjectFrame.cpp
 +++ b/layout/generic/nsObjectFrame.cpp
-@@ -1421,7 +1421,7 @@ nsObjectFrame::PaintPlugin(nsIRenderingC
-        * to tell the plugin where it is, we dispatch a NPWindow through
-        * |HandleEvent| to tell the plugin when its window moved
-        */
--      nsRefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-+      RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
-       gfxMatrix ctxMatrix = ctx->CurrentMatrix();
-       if (ctxMatrix.HasNonTranslation()) {
-         // soo; in the future, we should be able to render
 @@ -1443,7 +1443,7 @@ nsObjectFrame::PaintPlugin(nsIRenderingC
  
        /* Set the device offsets as appropriate, for whatever our current group offsets might be */
        gfxFloat xoff, yoff;
 -      nsRefPtr<gfxASurface> surf = ctx->CurrentSurface(&xoff, &yoff);
 +      RefPtr<gfxASurface> surf = ctx->CurrentSurface(&xoff, &yoff);
  
        if (surf->CairoStatus() != 0) {
@@ -4046,38 +3956,38 @@ diff --git a/widget/src/cocoa/nsChildVie
  
  #import <Carbon/Carbon.h>
  #import <Cocoa/Cocoa.h>
  
 -class gfxASurface;
  class nsChildView;
  union nsPluginPort;
  
-@@ -404,7 +404,7 @@ protected:
+@@ -367,7 +367,7 @@ protected:
    nsWeakPtr             mAccessible;
  #endif
  
 -  nsRefPtr<gfxASurface> mTempThebesSurface;
 +  RefPtr<gfxASurface> mTempThebesSurface;
  
    PRPackedBool          mVisible;
    PRPackedBool          mDrawing;
 diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm
 --- a/widget/src/cocoa/nsChildView.mm
 +++ b/widget/src/cocoa/nsChildView.mm
-@@ -2661,7 +2661,7 @@ NSEvent* gLastDragEvent = nil;
+@@ -2657,7 +2657,7 @@ NSEvent* gLastDragEvent = nil;
    mGeckoChild->GetBounds(geckoBounds);
  
    NSRect bounds = [self bounds];
 -  nsRefPtr<gfxQuartzSurface> targetSurface =
 +  RefPtr<gfxQuartzSurface> targetSurface =
      new gfxQuartzSurface(cgContext, gfxSize(bounds.size.width, bounds.size.height));
  
  #ifdef DEBUG_UPDATE
-@@ -2674,7 +2674,7 @@ NSEvent* gLastDragEvent = nil;
+@@ -2670,7 +2670,7 @@ NSEvent* gLastDragEvent = nil;
    fprintf (stderr, "  xform in: [%f %f %f %f %f %f]\n", xform.a, xform.b, xform.c, xform.d, xform.tx, xform.ty);
  #endif
  
 -  nsRefPtr<gfxContext> targetContext = new gfxContext(targetSurface);
 +  RefPtr<gfxContext> targetContext = new gfxContext(targetSurface);
  
    nsCOMPtr<nsIRenderingContext> rc;
    mGeckoChild->GetDeviceContext()->CreateRenderingContextInstance(*getter_AddRefs(rc));
--- a/registration-order-test-fixup
+++ b/registration-order-test-fixup
@@ -2,19 +2,19 @@ diff --git a/xpcom/tests/TestHarness.h b
 --- a/xpcom/tests/TestHarness.h
 +++ b/xpcom/tests/TestHarness.h
 @@ -1,4 +1,4 @@
 -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  /* ***** BEGIN LICENSE BLOCK *****
   * Version: MPL 1.1/GPL 2.0/LGPL 2.1
   *
-@@ -50,9 +50,23 @@
- #include <stdio.h>
- #include <stdlib.h>
+@@ -81,9 +81,23 @@ void passed(const char* test)
+ }
+ 
  
 +class ScopedLogging
 +{
 +public:
 +    ScopedLogging()
 +    {
 +        NS_LogInit();
 +    }
@@ -27,29 +27,29 @@ diff --git a/xpcom/tests/TestHarness.h b
 +
  class ScopedXPCOM
  {
 -  public:
 +public:
      ScopedXPCOM(const char* testName,
                  nsIDirectoryServiceProvider *dirSvcProvider = NULL)
      {
-@@ -88,7 +102,7 @@ class ScopedXPCOM
+@@ -119,7 +133,7 @@ class ScopedXPCOM
        return mServMgr == NULL;
      }
  
 -  private:
 +private:
      const char* mTestName;
      nsIServiceManager* mServMgr;
  };
 diff --git a/xpcom/tests/TestRegistrationOrder.cpp b/xpcom/tests/TestRegistrationOrder.cpp
 --- a/xpcom/tests/TestRegistrationOrder.cpp
 +++ b/xpcom/tests/TestRegistrationOrder.cpp
-@@ -250,6 +250,8 @@ int main(int argc, char** argv)
+@@ -249,6 +249,8 @@ int main(int argc, char** argv)
      return 1;
    }
  
 +  ScopedLogging log;
 +
    const char *regPath = argv[1];
    RegOrderDirSvcProvider *dirSvcProvider = new RegOrderDirSvcProvider(regPath);
    if (NULL == dirSvcProvider)
new file mode 100644
--- /dev/null
+++ b/remove-cyclec2
@@ -0,0 +1,56 @@
+diff --git a/toolkit/components/places/src/nsNavHistoryResult.cpp b/toolkit/components/places/src/nsNavHistoryResult.cpp
+--- a/toolkit/components/places/src/nsNavHistoryResult.cpp
++++ b/toolkit/components/places/src/nsNavHistoryResult.cpp
+@@ -104,16 +104,6 @@ inline PRInt32 CompareIntegers(PRUint32 
+ 
+ // nsNavHistoryResultNode ******************************************************
+ 
+-
+-NS_IMPL_CYCLE_COLLECTION_CLASS(nsNavHistoryResultNode)
+-
+-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsNavHistoryResultNode)
+-  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParent)
+-NS_IMPL_CYCLE_COLLECTION_UNLINK_END 
+-
+-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsNavHistoryResultNode)
+-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mParent, nsINavHistoryContainerResultNode);
+-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+ 
+ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNavHistoryResultNode)
+   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsINavHistoryResultNode)
+@@ -3696,35 +3686,6 @@ RemoveBookmarkFolderObserversCallback(ns
+   return PL_DHASH_REMOVE;
+ }
+ 
+-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsNavHistoryResult)
+-  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mRootNode)
+-  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mView)
+-  tmp->mBookmarkFolderObservers.Enumerate(&RemoveBookmarkFolderObserversCallback, nsnull);
+-NS_IMPL_CYCLE_COLLECTION_UNLINK_END 
+-
+-PR_STATIC_CALLBACK(PLDHashOperator)
+-TraverseBookmarkFolderObservers(nsTrimInt64HashKey::KeyType aKey,
+-                                nsNavHistoryResult::FolderObserverList*& aData,
+-                                void* aUserArg)
+-{
+-  nsCycleCollectionTraversalCallback* cb =
+-    static_cast<nsCycleCollectionTraversalCallback*>(aUserArg);
+-  PRUint32 i, count = aData->Length();
+-  for (i = 0; i < count; ++i) {
+-    NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*cb,
+-                                       "mBookmarkFolderObservers value[i]");
+-    nsNavHistoryResultNode* node = aData->ElementAt(i);
+-    cb->NoteXPCOMChild(node);
+-  }
+-  return PL_DHASH_NEXT;
+-}
+-
+-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsNavHistoryResult)
+-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRootNode, nsINavHistoryContainerResultNode)
+-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mView)
+-  tmp->mBookmarkFolderObservers.Enumerate(&TraverseBookmarkFolderObservers, &cb);
+-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+-
+ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsNavHistoryResult)
+ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsNavHistoryResult)
+ 
--- a/root-atoms
+++ b/root-atoms
@@ -509,17 +509,17 @@ diff --git a/xpcom/ds/nsAtomTable.cpp b/
 -               "converting atom that's already permanent");
 -
 -  // Just let the constructor overwrite the vtable pointer.
 -  return aAtom;
 +  return MMgc::GCFinalizedObject::operator new(size, NS_GetGC(), extra);
  }
  
  NS_IMETHODIMP 
-@@ -549,86 +331,6 @@ AtomImpl::Equals(const nsAString& aStrin
+@@ -549,88 +331,6 @@ AtomImpl::Equals(const nsAString& aStrin
  
  //----------------------------------------------------------------------
  
 -// wrapper class for the nsStaticAtom struct
 -
 -NS_IMETHODIMP_(nsrefcnt)
 -nsStaticAtomWrapper::AddRef()
 -{
@@ -593,20 +593,22 @@ diff --git a/xpcom/ds/nsAtomTable.cpp b/
 -  PL_ARENA_ALLOCATE(mem, gStaticAtomArena, sizeof(nsStaticAtomWrapper));
 -
 -  nsStaticAtomWrapper* wrapper =
 -    new (mem) nsStaticAtomWrapper(aAtom, aLength);
 -
 -  return wrapper;
 -}
 -
+-#define ATOM_HASHTABLE_INITIAL_SIZE  4096
+-
  static inline AtomTableEntry*
  GetAtomHashEntry(const char* aString, PRUint32 aLength)
  {
-@@ -661,58 +363,67 @@ GetAtomHashEntry(const PRUnichar* aStrin
+@@ -663,58 +363,67 @@ GetAtomHashEntry(const PRUnichar* aStrin
                      (PL_DHashTableOperate(&gAtomTable, &key, PL_DHASH_ADD));
  }
  
 +static PLDHashOperator
 +MarkPermanentAtoms(PLDHashTable *table, PLDHashEntryHdr *hdr,
 +                   PRUint32 number, void *arg)
 +{
 +  AtomTableEntry *entry = static_cast<AtomTableEntry*>(hdr);
@@ -706,17 +708,17 @@ diff --git a/xpcom/ds/nsAtomTable.cpp b/
 -}
 -
 -NS_COM nsIAtom*
 -NS_NewAtom(const nsACString& aUTF8String)
 +NS_NewAtom(const nsACString& aUTF8String, PRBool aPermanent)
  {
    AtomTableEntry *he = GetAtomHashEntry(aUTF8String.Data(),
                                          aUTF8String.Length());
-@@ -724,17 +435,16 @@ NS_NewAtom(const nsACString& aUTF8String
+@@ -726,17 +435,16 @@ NS_NewAtom(const nsACString& aUTF8String
    NS_ASSERTION(!he->IsUTF8String() && !he->IsUTF16String(),
                 "Atom hash entry is string?  Should be atom!");
  
 -  if (he->HasValue())
 -    return he->GetAtom();
 +  if (he->HasValue()) {
 +    AtomImpl *impl = he->GetAtomImpl();
 +    if (aPermanent)
@@ -731,17 +733,17 @@ diff --git a/xpcom/ds/nsAtomTable.cpp b/
    }
  
 -  NS_ADDREF(atom);
 +  AtomImpl* atom = new (aUTF8String.Length()) AtomImpl(aUTF8String, aPermanent);
 +  he->SetAtomImpl(atom);
    return atom;
  }
  
-@@ -745,76 +455,27 @@ NS_NewAtom(const PRUnichar* aUTF16String
+@@ -747,76 +455,27 @@ NS_NewAtom(const PRUnichar* aUTF16String
  }
  
  NS_COM nsIAtom*
 -NS_NewAtom(const nsAString& aUTF16String)
 +NS_NewAtom(const nsAString& aUTF16String, PRBool aPermanent)
  {
    AtomTableEntry *he = GetAtomHashEntry(aUTF16String.Data(),
                                          aUTF16String.Length());
new file mode 100644
--- /dev/null
+++ b/root-atoms2
@@ -0,0 +1,12 @@
+diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp
+--- a/xpcom/ds/nsAtomTable.cpp
++++ b/xpcom/ds/nsAtomTable.cpp
+@@ -331,6 +331,8 @@ AtomImpl::Equals(const nsAString& aStrin
+ 
+ //----------------------------------------------------------------------
+ 
++#define ATOM_HASHTABLE_INITIAL_SIZE  4096
++
+ static inline AtomTableEntry*
+ GetAtomHashEntry(const char* aString, PRUint32 aLength)
+ {
--- a/series
+++ b/series
@@ -1,10 +1,10 @@
-# This series is currently based against actionmonkey-jorendorff
-# revision b45b565d6d28
+# This series is currently based against a local merge
+# revision 7ed3f49e5c0d
 crashrepoter-notparallel
 core-refcounting
 template-hashtable-getters
 gfx-refcounting
 64bit
 nscore-class-annotation-types
 psm-remove-init-isupports
 success-macros.patch
@@ -39,20 +39,22 @@ compmgr-more
 content-hashtables
 xslt-gc
 chromereg-gc
 gcobject-nodelete.patch
 root-compmgr
 NS_RootUntilShutdown
 root-atoms
 mark-jsprivate
+root-atoms2
 root-threads
 more-template-typedefs
 revert-xpcomgc-cookie-madness
 system-metrics-comarray
+remove-cyclec2
 revert-xpccallcontext
 xpcom-request-contexts
 set-default-jscontext
 no-socketts-deadlock
 root-jscomponentloader-script
 nativescriptableshared-gcobject
 root-contentutils
 mark-observerservice
--- a/shell-loginit
+++ b/shell-loginit
@@ -1,14 +1,14 @@
 * * *
 
 diff --git a/js/src/xpconnect/shell/xpcshell.cpp b/js/src/xpconnect/shell/xpcshell.cpp
 --- a/js/src/xpconnect/shell/xpcshell.cpp
 +++ b/js/src/xpconnect/shell/xpcshell.cpp
-@@ -1287,9 +1287,25 @@ ContextCallback(JSContext *cx, uintN con
+@@ -1298,12 +1298,29 @@ ContextCallback(JSContext *cx, uintN con
      return JS_TRUE;
  }
  
 +class AutoLogger
 +{
 +public:
 +    AutoLogger()
 +    {
@@ -19,13 +19,17 @@ diff --git a/js/src/xpconnect/shell/xpcs
 +    {
 +        NS_LogTerm();
 +    }
 +};
 +
  int
  main(int argc, char **argv, char **envp)
  {
+ #ifdef XP_MACOSX
+     InitAutoreleasePool();
+ #endif
++
 +    AutoLogger log;
 +
      JSRuntime *rt;
      JSContext *cx;
      JSObject *glob, *envobj;
--- a/static-check-gc-attributes
+++ b/static-check-gc-attributes
@@ -1,27 +1,12 @@
 Add basic static checking of gc types and correct inheritance of GCFinalizable. I found out that it's not actually catching 90% of the stack classes, for reasons I haven't figured out. This patch actually kinda sucks, so I'm going to go back to the beginning and make this entire script pure treehydra.
 * * *
 Treehydra rocks. Dehydra is so-so. Switch the rest of this to use treehydra!
 
-diff --git a/config/config.mk b/config/config.mk
---- a/config/config.mk
-+++ b/config/config.mk
-@@ -524,9 +524,10 @@ endif
- # script. Additional scripts may be added by specific subdirectories.
- 
- DEHYDRA_SCRIPTS = $(topsrcdir)/xpcom/analysis/static-checking.js
-+DEHYDRA_ARGS = --topsrcdir=$(topsrcdir) --objdir=$(DEPTH)
- 
- ifdef DEHYDRA_PATH
--DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) $(foreach script,$(DEHYDRA_SCRIPTS),-fplugin-arg=$(script))
-+DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) $(foreach script,$(DEHYDRA_SCRIPTS),-fplugin-arg="$(script) $(DEHYDRA_ARGS)")
- OS_CXXFLAGS += $(DEHYDRA_FLAGS)
- endif
- 
 diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h
 --- a/xpcom/base/nscore.h
 +++ b/xpcom/base/nscore.h
 @@ -487,17 +487,35 @@ typedef PRUint32 nsrefcnt;
   *
   * NS_STACK_CLASS: a class which must only be instantiated on the stack
   * NS_FINAL_CLASS: a class which may not be subclassed
 + * NS_GC_TYPE    : a class which must be GC-allocated
--- a/system-metrics-comarray
+++ b/system-metrics-comarray
@@ -58,38 +58,38 @@ diff --git a/layout/style/nsCSSRuleProce
  
    rv = lookAndFeel->GetMetric(nsILookAndFeel::eMetric_WindowsDefaultTheme, metricResult);
    if (NS_SUCCEEDED(rv) && metricResult) {
 -    sSystemMetrics->AppendElement(do_GetAtom("windows-default-theme"));
 +    sSystemMetrics->AppendObject(do_GetAtom("windows-default-theme"));
    }
  
    return PR_TRUE;
-@@ -1183,8 +1183,7 @@ static PRBool SelectorMatches(RuleProces
+@@ -1312,8 +1312,7 @@ static PRBool SelectorMatches(RuleProces
        }
-       NS_ASSERTION(pseudoClass->mString, "Must have string!");
-       nsCOMPtr<nsIAtom> metric = do_GetAtom(pseudoClass->mString);
+       NS_ASSERTION(pseudoClass->u.mString, "Must have string!");
+       nsCOMPtr<nsIAtom> metric = do_GetAtom(pseudoClass->u.mString);
 -      result = sSystemMetrics->IndexOf(metric) !=
 -               sSystemMetrics->NoIndex;
 +      result = sSystemMetrics->IndexOf(metric) != -1;
      }
      else if (nsCSSPseudoClasses::mozHasHandlerRef == pseudoClass->mAtom) {
        nsIContent *child = nsnull;
-@@ -1673,8 +1672,8 @@ static void ContentEnumFunc(nsICSSStyleR
+@@ -1804,8 +1803,8 @@ static void ContentEnumFunc(nsICSSStyleR
        // nsICSSStyleRule return the same pointer for nsIStyleRule (why
        // would anything multiply inherit nsIStyleRule anyway?)
  #ifdef DEBUG
 -      nsCOMPtr<nsIStyleRule> iRule = do_QueryInterface(aRule);
 -      NS_ASSERTION(static_cast<nsIStyleRule*>(aRule) == iRule.get(),
 +      nsIStyleRule* iRule = do_QueryInterface(aRule);
 +      NS_ASSERTION(static_cast<nsIStyleRule*>(aRule) == iRule,
                     "Please fix QI so this performance optimization is valid");
  #endif
        data->mRuleWalker->Forward(static_cast<nsIStyleRule*>(aRule));
-@@ -1738,8 +1737,8 @@ static void PseudoEnumFunc(nsICSSStyleRu
+@@ -1869,8 +1868,8 @@ static void PseudoEnumFunc(nsICSSStyleRu
      // nsICSSStyleRule return the same pointer for nsIStyleRule (why
      // would anything multiply inherit nsIStyleRule anyway?)
  #ifdef DEBUG
 -    nsCOMPtr<nsIStyleRule> iRule = do_QueryInterface(aRule);
 -    NS_ASSERTION(static_cast<nsIStyleRule*>(aRule) == iRule.get(),
 +    nsIStyleRule* iRule = do_QueryInterface(aRule);
 +    NS_ASSERTION(static_cast<nsIStyleRule*>(aRule) == iRule,
                   "Please fix QI so this performance optimization is valid");