Bug 1332704. Have ~nsDocument actually clear the self-pointer from _all_ its sheets, and reenable Rule::IsKnownLive bits that depends on that pointer being managed correctly. r=heycam

This commit is contained in:
Boris Zbarsky 2017-01-23 11:15:58 -05:00
parent cc8f541aaa
commit fde7c43bb1
2 changed files with 5 additions and 5 deletions

View File

@ -1487,6 +1487,11 @@ nsDocument::~nsDocument()
for (StyleSheet* sheet : mStyleSheets) {
sheet->ClearAssociatedDocument();
}
for (auto& sheets : mAdditionalSheets) {
for (StyleSheet* sheet : sheets) {
sheet->ClearAssociatedDocument();
}
}
if (mAttrStyleSheet) {
mAttrStyleSheet->SetOwningDocument(nullptr);
}

View File

@ -83,10 +83,6 @@ Rule::IsKnownLive() const
return true;
}
#if 1
return false;
#else
// Disabled pending bug 1332704 getting resolved for now.
StyleSheet* sheet = GetStyleSheet();
if (!sheet) {
return false;
@ -98,7 +94,6 @@ Rule::IsKnownLive() const
return nsCCUncollectableMarker::InGeneration(
sheet->GetAssociatedDocument()->GetMarkedCCGeneration());
#endif
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(Rule)