if (aCopy.mRuleCollection && aCopy.mRuleCollection->mRulesAccessed) { EnsureUniqueInner(); }  if (aCopy.mMedia) { NS_NewISupportsArray(&mMedia); if (mMedia) { mMedia->AppendElements(aCopy.mMedia); } }  if (aCopy.mFirstChild) { CSSStyleSheetImpl*  otherChild = aCopy.mFirstChild; CSSStyleSheetImpl** ourSlot = &mFirstChild; do { CSSStyleSheetImpl* child = new CSSStyleSheetImpl(*otherChild); if (child) { NS_ADDREF(child); (*ourSlot) = child; ourSlot = &(child->mNext); } otherChild = otherChild->mNext; } while (otherChild && ourSlot); }
CSSStyleSheetImpl::CSSStyleSheetImpl()  : nsICSSStyleSheet(),    mTitle(),     mMedia(nsnull),    mFirstChild(nsnull),     mNext(nsnull),    mParent(nsnull),    mImportsCollection(nsnull),    mRuleCollection(nsnull),    mDocument(nsnull),    mOwningNode(nsnull),    mDisabled(PR_FALSE),    mDirty(PR_FALSE),    mScriptObject(nsnull){  MOZ_COUNT_CTOR(CSSStyleSheetImpl);  NS_INIT_REFCNT();  mInner = new CSSStyleSheetInner(this);#ifdef DEBUG_REFS  ++gInstanceCount;  fprintf(stdout, "%d + CSSStyleSheet size: %d\n", gInstanceCount, sizeof(*this));#endif}