mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Bug 1655520 - Replace nsDocShell::GetAllDocShellsInSubtree in OnPrefChange, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D85342
This commit is contained in:
parent
c7563ad7c8
commit
49add6eaa8
@ -31,17 +31,18 @@ void OnPrefChange(const char* aPrefName, void*) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> rootDocShell = window->GetDocShell();
|
||||
nsTArray<RefPtr<nsIDocShell>> docShells;
|
||||
rootDocShell->GetAllDocShellsInSubtree(
|
||||
nsIDocShell::typeAll, nsIDocShell::ENUMERATE_FORWARDS, docShells);
|
||||
for (auto& docShell : docShells) {
|
||||
if (nsCOMPtr<nsPIDOMWindowOuter> win = do_GetInterface(docShell)) {
|
||||
if (dom::Document* doc = win->GetExtantDoc()) {
|
||||
RefPtr<BrowsingContext> context = window->GetBrowsingContext();
|
||||
MOZ_DIAGNOSTIC_ASSERT(context);
|
||||
|
||||
if (context->IsDiscarded()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
context->PreOrderWalk([](BrowsingContext* aContext) {
|
||||
if (dom::Document* doc = aContext->GetDocument()) {
|
||||
doc->ResetDocumentDirection();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user