author | L. David Baron <dbaron@dbaron.org> |
Fri, 14 Jan 2011 19:57:53 -0800 | |
changeset 60640 | 3d46204494379ba37443ee54bcf3c9b2d6f8a239 |
parent 60639 | fe3f812af314da1e34eab655acb88326d4716516 |
child 60641 | ee45778d91fa18e9e1c2a03ff8e47906460f2755 |
push id | 1 |
push user | root |
push date | Tue, 26 Apr 2011 22:38:44 +0000 |
treeherder | mozilla-beta@bfdb6e623a36 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bzbarsky |
bugs | 623351 |
milestone | 2.0b10pre |
first release with | nightly linux32
3d4620449437
/
4.0b10pre
/
20110115030345
/
files
nightly linux64
3d4620449437
/
4.0b10pre
/
20110115030345
/
files
nightly mac
3d4620449437
/
4.0b10pre
/
20110115030345
/
files
nightly win32
3d4620449437
/
4.0b10pre
/
20110115030345
/
files
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
4.0b10pre
/
20110115030345
/
pushlog to previous
nightly linux64
4.0b10pre
/
20110115030345
/
pushlog to previous
nightly mac
4.0b10pre
/
20110115030345
/
pushlog to previous
nightly win32
4.0b10pre
/
20110115030345
/
pushlog to previous
|
--- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -828,16 +828,25 @@ CloneRuleInto(nsICSSRule* aRule, void* a struct ChildSheetListBuilder { nsRefPtr<nsCSSStyleSheet>* sheetSlot; nsCSSStyleSheet* parent; void SetParentLinks(nsCSSStyleSheet* aSheet) { aSheet->mParent = parent; aSheet->SetOwningDocument(parent->mDocument); } + + static void ReparentChildList(nsCSSStyleSheet* aPrimarySheet, + nsCSSStyleSheet* aFirstChild) + { + for (nsCSSStyleSheet *child = aFirstChild; child; child = child->mNext) { + child->mParent = aPrimarySheet; + child->SetOwningDocument(aPrimarySheet->mDocument); + } + } }; PRBool nsCSSStyleSheet::RebuildChildList(nsICSSRule* aRule, void* aBuilder) { PRInt32 type = aRule->GetType(); if (type < nsICSSRule::IMPORT_RULE) { // Keep going till we get to the import rules. @@ -923,16 +932,18 @@ nsCSSStyleSheetInner::RemoveSheet(nsCSSS delete this; return; } if (aSheet == mSheets.ElementAt(0)) { mSheets.RemoveElementAt(0); NS_ASSERTION(mSheets.Length(), "no parents"); mOrderedRules.EnumerateForwards(SetStyleSheetReference, mSheets.ElementAt(0)); + + ChildSheetListBuilder::ReparentChildList(mSheets[0], mFirstChild); } else { mSheets.RemoveElement(aSheet); } } static void AddNamespaceRuleToMap(nsICSSRule* aRule, nsXMLNameSpaceMap* aMap)