Open Bug 1678480 Opened 4 years ago Updated 3 years ago

[Fission] [meta] Fix canvas drawWindow() calls to chrome function drawSnapshot() or extension API captureTab()

Categories

(Core :: Graphics, task, P3)

task

Tracking

()

Fission Milestone Future

People

(Reporter: cpeterson, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: meta)

In bug 1664444 comment 0, zombie says:

The canvas drawWindow method is sync, and thus can't be Fission-compatible for OOP iframes.

In bug 1636508, I introduced additional arguments to the tabs.captureTab method to specify an area of the document, and the scale (devicePixelRatio). They're not documented yet on MDN, but you should be able to understand them from the schema or tests in the second patch.

Depends on: 1568833, 1571419

Moving to the WebExtensions product because it looks like captureTab() is a WebExtension API (bug 1427463).

Canvas drawWindow() callers need to be fixed for Fission.

Blocks: 1427463
Severity: N/A → --
Component: DOM: Content Processes → Untriaged
Priority: P2 → --
Product: Core → WebExtensions
Depends on: 1678483
Flags: needinfo?(tomica)

I'm not sure what this bug is about exactly Chris.

My quote from bug 1664444 comment 0 was specifically about the Screenshots extensions, and the need for it stop using canvas drawWindow() method. The recommendation to switch to using tabs.captureTab() only applies to extensions. Other chrome JS (and possible c++?) users of drawWindow() probably need to switch to use WindowGlobalParent.drawSnapshot() directly, just as my implementation of captureTab() does.

https://searchfox.org/mozilla-central/rev/88f679f680/dom/chrome-webidl/WindowGlobalActors.webidl#104-120

If this was meant to be a "audit and fix all uses of drawWindow() in tree" meta bug, then a different product/component is probably a better place for it.

Flags: needinfo?(tomica) → needinfo?(cpeterson)

If this was meant to be a "audit and fix all uses of drawWindow() in tree" meta bug, then a different product/component is probably a better place for it.

Yes. So I'll move this bug to a more appropriate component.

We should audit the drawWindow() calls soon (Fission M6c), but actually fixing all the calls can probably happen later (Fission M7 Beta or later).

Severity: -- → N/A
Component: Untriaged → Graphics
Flags: needinfo?(cpeterson)
Priority: -- → P3
Product: WebExtensions → Core
Summary: [Fission] [meta] Change canvas drawWindow() calls to captureTab() → [Fission] [meta] Audit and change canvas drawWindow() calls to chrome function drawSnapshot() or extension API captureTab()

The MDN docs for drawWindow() have a big deprecation warning:

This API cannot be used by Web content. It is synchronous, and as such can't capture cross-origin (out of process) iframes with Fission. If you're using it from an extension, you should switch to tabs.captureTab. If you're writing chrome code, you probably want WindowGlobalParent.drawSnapshot from the parent process.

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow

This Extensions blog post warns that drawWindow() won't work with Fission and introduces the captureTab() and captureVisibleTab() replacement APIs:

https://blog.mozilla.org/addons/2020/10/07/extensions-in-firefox-82/

Andreas Wagner is searching the code of AMO extensions for drawWindow() callers and DRAWWINDOW_ flags. We can then reach out to affected extension developers.

Depends on: 1680359

Steven, please audit the uses of drawWindow() for M6c and file bugs for the remaining uses. We should then rename this bug for fixing these uses and target it for M7.

Flags: needinfo?(smacleod)
Assignee: nobody → smacleod
Status: NEW → ASSIGNED
Fission Milestone: M6c → MVP
Flags: needinfo?(smacleod)
Depends on: 1682012
Depends on: 1682014
Depends on: 1682021
Depends on: 1682026
Depends on: 1682028
Depends on: 1682029

(In reply to Neha Kochar [:neha] from comment #5)

Steven, please audit the uses of drawWindow() for M6c and file bugs for the remaining uses. We should then rename this bug for fixing these uses and target it for M7.

Done. There are uses in tests I didn't audit, but I think any test calls left after the feature code is fixed should be handled in Bug 1680359.

Assignee: smacleod → nobody
Status: ASSIGNED → NEW
Summary: [Fission] [meta] Audit and change canvas drawWindow() calls to chrome function drawSnapshot() or extension API captureTab() → [Fission] [meta] Fix canvas drawWindow() calls to chrome function drawSnapshot() or extension API captureTab()
Depends on: 1682335
Depends on: 1682355
No longer depends on: 1682355
Depends on: 1682355
No longer depends on: 1680359
No longer depends on: 1682355

This is a meta tracking work related to uses of drawWindow which in some cases no longer works with Fission. There's no development work required in this specific bug.

This meta bug doesn't need to block our Fission MVP milestone. Some of the individual blocking bugs may, though.

Fission Milestone: MVP → Future
You need to log in before you can comment on or make changes to this bug.