Closed Bug 1661869 Opened 4 years ago Closed 3 years ago

Firefox Screenshots Fail to Capture Canvas Elements

Categories

(Core :: Graphics, defect, P2)

80 Branch
defect

Tracking

()

VERIFIED FIXED
94 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox-esr91 94+ verified
firefox79 --- wontfix
firefox80 --- wontfix
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- wontfix
firefox92 --- wontfix
firefox93 + wontfix
firefox94 + verified

People

(Reporter: artemx100, Assigned: jgilbert)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

  1. Visit https://teemo.gg/model-viewer?skinid=nami-15&model-type=champions
  2. Scroll down and try to take a screenshot of the canvas element

Actual results:

The canvas element is invisible in the screenshot

Expected results:

The canvas element should appear in the screenshot.

For what it matters, I tested and it works properly in Firefox 66.0.5, however it does not work in Firefox 79.0, meaning the regression happened somewhere between those two versions.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Screenshots
Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Keywords: regression
Regressed by: 1642994
Component: Screenshots → Graphics
Product: Firefox → Core

Jeff can you take a look?

Flags: needinfo?(jgilbert)

Hi Kris, can you set the severity for this bug, please?

Flags: needinfo?(ktaeleman)

ni? emma to put on your radar.

Flags: needinfo?(emalysz)
Severity: -- → S3
Flags: needinfo?(ktaeleman)
Flags: needinfo?(jgilbert)
Priority: -- → P3

Thanks for the regression window, Alice!

Flags: needinfo?(emalysz)

Wondering if this should be higher than P3.

Flags: needinfo?(gpascutto)

Any particular reason? The regressor identified dates back to July 9, and this wasn't found until 2 months later, so it doesn't look like this is frequently hit. Maybe we can make an argument that it should go before trying to fix the perf issues, perhaps.

Flags: needinfo?(gpascutto)

Hey :artemx100, thanks for reporting this. Are you still seeing this issue?

I believe this may have been fixed by Bug 1660651, as I can no longer reproduce

Flags: needinfo?(artemx100)

(In reply to Emma Malysz from comment #10)

Hey :artemx100, thanks for reporting this. Are you still seeing this issue?

I believe this may have been fixed by Bug 1660651, as I can no longer reproduce

Yes, I still can. The issue is still unsolved in the most recent nightly build.
Tested with both my current and a fresh profile.
Version 84.0a1
Build ID 20201103095421

Flags: needinfo?(artemx100)

Thanks! It looks like this issue does not affect Mac, but I was able to reproduce on Windows

This feels like a regression that should be getting on someone's radar rather than slipping release after release. Any chance we can revisit the prioritization here?

Attached image screenshot

This still trivially reproduces for me on any WebGL content on Windows 10, even simple content like the MDN page below:
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/By_example/Clearing_with_colors

Jim, does a simpler testcase make this easier to prioritize?

Flags: needinfo?(jmathies)
Blocks: gfx-triage
Flags: needinfo?(jmathies)
Depends on: 1685388

WebGL related, gcp and JeffG know about this.

No longer blocks: gfx-triage

I just noticed this bug impacts taking screenshots of Google Maps. Seems kinda bad. Do we have any idea what's broken here and how to fix it? I might be able to find someone to work on it if JeffG is too busy.

Flags: needinfo?(gpascutto)

Jim, I think Jeff tried to debug this, and then ran into the bug this depends on, i.e. that the feature is completely broken in debug mode, which complicated things. I think he was going to look again when that gets fixed...but we can't seem to get traction in that team.

If you feel it's urgent and have availability, feel free to take it.

Flags: needinfo?(gpascutto)

Hmm, there's at least a WIP patch in the other bug now.

I can revisit the patch in Bug 1685388.

Priority: P3 → P2

Thank you very much Emma! That will probably help whoever ends up tackling that bug.

I ran into this today taking a screenshot of google maps. I'd like to try and figure out what's going wrong here and get it fixed.

Blocks: gfx-triage
No longer blocks: gfx-triage

Reproducible in 91.0.1 x64. Check Google Maps or, for example, Johns Hopkins University's COVID-19 statistics page.
https://www.arcgis.com/apps/dashboards/bda7594740fd40299423467b48e9ecf6
Unfortunately, cannot tell exactly when it started but a few releases ago (~ v85.x) it worked well.

This is not an S3 bug if it affects major sites like Google Maps. We need to bump this up in priority and figure out a path forward.

Severity: S3 → S2
Flags: needinfo?(jmathies)
Flags: needinfo?(emalysz)

Since I believe this is an issue with browser.tabs.captureTab, I want to point out that the API is also used to report a site issue (https://searchfox.org/mozilla-central/rev/4d90ff4537330d6b17cb956c0fadf759086d9bb7/browser/extensions/report-site-issue/background.js#106-109).

Maybe triggering from that flow will unblock this bug from Bug 1685388.

Regardless, I'm going to be prioritizing the screenshots work. Waiting on another debug build, hopefully this time I'll be able to reproduce

Flags: needinfo?(emalysz)

We weren't able to reproduce the issue in Bug 1685388. Provided no one is having the issue with screenshots in a debug build, I think this bug is considered unblocked and can be worked on

Here's an instant-loading example that screenshotting fails on: https://jdashg.github.io/misc/webgl/ping-pong.html

For WebGL canvases with preserveDrawingBuffer:false, frontbuffer
snapshotting was not working properly.
If the frontbuffer had no user-fb associated with it,
was inexplicably calling BindDefaultFBForRead, which binds
webgl's default FB, not gl's default FB 0.
This caused frontbuffer snappshotting to actually snapshot the (cleared)
backbuffer instead of the visible frontbuffer contents.

Assignee: nobody → jgilbert
Status: NEW → ASSIGNED
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6b9c61565d44
Fix screenshotting of WebGL canvases. r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

Is there any way we can land a test for this? Also, please nominate for Beta and ESR91 approval when you get a chance.

Flags: needinfo?(jmathies) → needinfo?(jgilbert)

Yeah, in two stages I think:

  1. Test the related functionality via canvas.toDataURL()
  2. Add actual Screenshots test here: https://searchfox.org/mozilla-central/source/browser/extensions/screenshots/test/browser/browser.ini
Flags: needinfo?(jgilbert)

The patch landed in nightly and beta is affected.
:jgilbert, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jgilbert)

Jeff, are you planning an uplift into our last beta or should we mark it wontfix for 93? Thanks

[Tracking Requested - why for this release]:
It sucks for users when screenshotting inexplicably doesn't work for some content, which users may not even realize is webgl.

Flags: needinfo?(jgilbert)

Per discussion with Jeff, better to let this bake more given where we are in the cycle. Let's aim to get this into 91.3esr next cycle.

Flags: qe-verify+

Comment on attachment 9241879 [details]
Bug 1661869 - Fix screenshotting of WebGL canvases.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Fix screenshotting of webgl canvases, such as Google Maps
  • User impact if declined: Screenshotting of some canvases will continue to be broken.
  • Fix Landed on Version: 94
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It has baked in 94 now, and few changes have happened between 91 and 94 in this area.
  • String or UUID changes made by this patch: none
Attachment #9241879 - Flags: approval-mozilla-esr91?
QA Whiteboard: [qa-triaged]

Reproduced the issue in Release 92, on google maps, using Win10.
Verified - Fixed in Beta 94.0b2 (build id: 20211005185813) and latest Nightly 95.0a1 (build id: 20211005094529). The screenshots are displayed accordingly, using google maps.

Comment on attachment 9241879 [details]
Bug 1661869 - Fix screenshotting of WebGL canvases.

Approved for 91.4esr.

Attachment #9241879 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

Verified - Fixed in 91.3.0esr (build id: 20211007190139) (https://hg.mozilla.org/releases/mozilla-esr91/rev/2d2658a85cef) on Win10. The screenshots are displayed correctly, using google maps.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: