Bug 1668784 - Return empty oop iframe metrics rather than no metrics for OOP iframes that we still haven't positioned and such. r=hiro

This is the right thing to do. If the compositor still hasn't sent
BrowserChild its visible position, then we should just be
non-intersecting, not carry on with the root document state.

Fix the test to not be racy, as the layout / positioning of the iframe
is async with Fission / Chromium site isolation enabled.

Differential Revision: https://phabricator.services.mozilla.com/D92240
This commit is contained in:
Emilio Cobos Álvarez
2020-10-02 21:30:37 +00:00
parent 80e7719885
commit 869f3bcf09
2 changed files with 8 additions and 6 deletions

View File

@@ -447,17 +447,17 @@ static Maybe<OopIframeMetrics> GetOopIframeMetrics(Document& aDocument,
PresShell* rootPresShell = rootDoc->GetPresShell();
if (!rootPresShell || rootPresShell->IsDestroying()) {
return Nothing();
return Some(OopIframeMetrics{});
}
nsIFrame* inProcessRootFrame = rootPresShell->GetRootFrame();
if (!inProcessRootFrame) {
return Nothing();
return Some(OopIframeMetrics{});
}
BrowserChild* browserChild = BrowserChild::GetFrom(rootDoc->GetDocShell());
if (!browserChild) {
return Nothing();
return Some(OopIframeMetrics{});
}
MOZ_DIAGNOSTIC_ASSERT(!browserChild->IsTopLevel());
@@ -470,7 +470,7 @@ static Maybe<OopIframeMetrics> GetOopIframeMetrics(Document& aDocument,
Maybe<LayoutDeviceRect> remoteDocumentVisibleRect =
browserChild->GetTopLevelViewportVisibleRectInSelfCoords();
if (!remoteDocumentVisibleRect) {
return Nothing();
return Some(OopIframeMetrics{});
}
return Some(OopIframeMetrics{