Bug 1636508 - Make tabs.captureTab compatible with Fission r=mattwoodrow,robwu,geckoview-reviewers,agi

Also fix WindowGlobalParent.drawSnapshot() to render the currently visible
viewport when called with a null rect, and clarify the webidl comment.

Differential Revision: https://phabricator.services.mozilla.com/D87971
This commit is contained in:
Tomislav Jovanovic
2020-08-25 11:30:52 +00:00
parent 2e046dd2ed
commit 525d056f46
10 changed files with 134 additions and 129 deletions

View File

@@ -623,8 +623,13 @@ already_AddRefed<mozilla::dom::Promise> WindowGlobalParent::DrawSnapshot(
return nullptr;
}
if (!gfx::CrossProcessPaint::Start(this, aRect, (float)aScale, color,
gfx::CrossProcessPaintFlags::None,
gfx::CrossProcessPaintFlags flags = gfx::CrossProcessPaintFlags::None;
if (!aRect) {
// If no explicit Rect was passed, we want the currently visible viewport.
flags = gfx::CrossProcessPaintFlags::DrawView;
}
if (!gfx::CrossProcessPaint::Start(this, aRect, (float)aScale, color, flags,
promise)) {
aRv = NS_ERROR_FAILURE;
return nullptr;