Bug 1662841: Remove Fission-incompatible `nsDocumentViewer::AppendSubtree`. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D90615
This commit is contained in:
Kris Maglione 2020-09-17 22:43:47 +00:00
Родитель bcd2f907ad
Коммит a3b66dd82c
5 изменённых файлов: 20 добавлений и 25 удалений

Просмотреть файл

@ -32,7 +32,6 @@ class WindowGlobalChild;
[ptr] native nsPresContextPtr(nsPresContext);
[ptr] native nsViewPtr(nsView);
[ptr] native nsDOMNavigationTimingPtr(nsDOMNavigationTiming);
[ref] native nsIContentViewerTArray(nsTArray<nsCOMPtr<nsIContentViewer> >);
[ptr] native Encoding(const mozilla::Encoding);
[ptr] native PresShellPtr(mozilla::PresShell);
[ptr] native WindowGlobalChildPtr(mozilla::dom::WindowGlobalChild);
@ -288,12 +287,6 @@ interface nsIContentViewer : nsISupports
void getContentSizeConstrained(in long maxWidth, in long maxHeight,
out long width, out long height);
/**
* Append |this| and all of its descendants to the given array,
* in depth-first pre-order traversal.
*/
[noscript] void appendSubtree(in nsIContentViewerTArray array);
/**
* Instruct the refresh driver to discontinue painting until further
* notice.

Просмотреть файл

@ -165,7 +165,7 @@ interface nsIDocShell : nsIDocShellTreeItem
* Content Viewer that is currently loaded for this DocShell. This may
* change as the underlying content changes.
*/
readonly attribute nsIContentViewer contentViewer;
[infallible] readonly attribute nsIContentViewer contentViewer;
/**
* Get the id of the outer window that is or will be in this docshell.

Просмотреть файл

@ -121,7 +121,7 @@ interface nsIDocShellTreeItem : nsISupports
@deprecated: Prefer using `BrowsingContext::Children()`, as this count will
not include out-of-process iframes.
*/
[binaryname(InProcessChildCount)]
[binaryname(InProcessChildCount), infallible]
readonly attribute long childCount;
/*

Просмотреть файл

@ -11123,6 +11123,23 @@ void PresShell::MarkFixedFramesForReflow(IntrinsicDirty aIntrinsicDirty) {
}
}
static void AppendSubtree(nsIDocShell* aDocShell,
nsTArray<nsCOMPtr<nsIContentViewer>>& aArray) {
if (nsCOMPtr<nsIContentViewer> cv = aDocShell->GetContentViewer()) {
aArray.AppendElement(cv);
}
int32_t n = aDocShell->GetInProcessChildCount();
for (int32_t i = 0; i < n; i++) {
nsCOMPtr<nsIDocShellTreeItem> childItem;
aDocShell->GetInProcessChildAt(i, getter_AddRefs(childItem));
if (childItem) {
nsCOMPtr<nsIDocShell> child(do_QueryInterface(childItem));
AppendSubtree(child, aArray);
}
}
}
void PresShell::MaybeReflowForInflationScreenSizeChange() {
nsPresContext* pc = GetPresContext();
const bool fontInflationWasEnabled = FontSizeInflationEnabled();
@ -11137,13 +11154,8 @@ void PresShell::MaybeReflowForInflationScreenSizeChange() {
return;
}
if (nsCOMPtr<nsIDocShell> docShell = pc->GetDocShell()) {
nsCOMPtr<nsIContentViewer> cv;
docShell->GetContentViewer(getter_AddRefs(cv));
if (!cv) {
return;
}
nsTArray<nsCOMPtr<nsIContentViewer>> array;
cv->AppendSubtree(array);
AppendSubtree(docShell, array);
for (uint32_t i = 0, iEnd = array.Length(); i < iEnd; ++i) {
nsCOMPtr<nsIContentViewer> cv = array[i];
if (RefPtr<PresShell> descendantPresShell = cv->GetPresShell()) {

Просмотреть файл

@ -2774,16 +2774,6 @@ nsDocumentViewer::SetHintCharset(const Encoding* aEncoding) {
CallChildren(childFn);
}
NS_IMETHODIMP nsDocumentViewer::AppendSubtree(
nsTArray<nsCOMPtr<nsIContentViewer>>& aArray) {
aArray.AppendElement(this);
auto childFn = [&aArray](nsDocumentViewer* aChild) {
aChild->AppendSubtree(aArray);
};
CallChildren(childFn);
return NS_OK;
}
NS_IMETHODIMP
nsDocumentViewer::PausePainting() {
CallChildren([](nsDocumentViewer* aChild) { aChild->PausePainting(); });