зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475351: Properly clear associated ShadowRoot from StyleSheet objects. r=smaug
Just like we do from the document's destructor. MozReview-Commit-ID: DygmZ0EI9es
This commit is contained in:
Родитель
dea0d7ad83
Коммит
de1504e650
|
@ -25,6 +25,13 @@ DocumentOrShadowRoot::DocumentOrShadowRoot(nsIDocument& aDoc)
|
|||
, mKind(Kind::Document)
|
||||
{}
|
||||
|
||||
DocumentOrShadowRoot::~DocumentOrShadowRoot()
|
||||
{
|
||||
for (StyleSheet* sheet : mStyleSheets) {
|
||||
sheet->ClearAssociatedDocumentOrShadowRoot();
|
||||
}
|
||||
}
|
||||
|
||||
StyleSheetList&
|
||||
DocumentOrShadowRoot::EnsureDOMStyleSheets()
|
||||
{
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
already_AddRefed<nsContentList>
|
||||
GetElementsByClassName(const nsAString& aClasses);
|
||||
|
||||
~DocumentOrShadowRoot() = default;
|
||||
~DocumentOrShadowRoot();
|
||||
|
||||
Element* GetPointerLockElement();
|
||||
Element* GetFullscreenElement();
|
||||
|
|
|
@ -1684,15 +1684,12 @@ nsDocument::~nsDocument()
|
|||
mFirstChild = nullptr;
|
||||
mCachedRootElement = nullptr;
|
||||
|
||||
// Let the stylesheets know we're going away
|
||||
for (StyleSheet* sheet : mStyleSheets) {
|
||||
sheet->ClearAssociatedDocumentOrShadowRoot();
|
||||
}
|
||||
for (auto& sheets : mAdditionalSheets) {
|
||||
for (StyleSheet* sheet : sheets) {
|
||||
sheet->ClearAssociatedDocumentOrShadowRoot();
|
||||
}
|
||||
}
|
||||
|
||||
if (mAttrStyleSheet) {
|
||||
mAttrStyleSheet->SetOwningDocument(nullptr);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче