Closed Bug 1737579 Opened 3 years ago Closed 3 years ago

iframe scaling in screenshot is incorrect with Fission

Categories

(Firefox :: Screenshots, defect, P2)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1751961
Tracking Status
firefox-esr91 --- disabled
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- affected

People

(Reporter: mossop, Unassigned)

References

Details

(Whiteboard: [fission])

Attachments

(2 files)

Attached image Image from Firefox screenshots (deleted) —

I just took a screenshot from a page in the Jira Service Management system and the saved image is scaled all wrong compared to what I see on screen.

Attached image Actual rendered content (deleted) —

Thanks for filing this :mossop. Can you get us more details on how to reproduce this?

  • What OS are you using?
  • Do you have any scaling set up in your OS' settings?
  • What is the Firefox zoom %age?
  • Can you share the URL of this page? Its particularly odd that some parts of it appears to be zoomed/scaled and not others.
  • Did you use the "Take Visible" button to take that screenshot, or some other method?
Severity: -- → S3
Flags: needinfo?(dtownsend)
Priority: -- → P2

(In reply to Sam Foster [:sfoster] (he/him) from comment #2)

Thanks for filing this :mossop. Can you get us more details on how to reproduce this?

  • What OS are you using?

macOS 12.0.1 (also occurred on 11.6)

  • Do you have any scaling set up in your OS' settings?

Doesn't appear to matter whether I do or not or which of my two monitors I use, the same issue occurs.

  • What is the Firefox zoom %age?

No zoom applied - 100%.

  • Can you share the URL of this page? Its particularly odd that some parts of it appears to be zoomed/scaled and not others.

https://mozilla-hub.atlassian.net/servicedesk/customer/portal/6

  • Did you use the "Take Visible" button to take that screenshot, or some other method?

I moved the mouse to choose the box area I wanted. Using "Save visible" shows the same issue. Using "Save full page" is fine though.

Flags: needinfo?(dtownsend)

:nik, Can you to investigate this?

Flags: needinfo?(nbaumgardner)

I found that is bug is occurring because of Fission. With Fission disabled, the screenshot is expected. With Fission enabled, the screenshot is zoomed in as shown above.

What I think is happening:
Mac has a device pixel ratio of 2.
The buttons are within an iframe and when screenshotting the visible page I think the iframe uses a device pixel ratio of 1 to take the screenshot and then when shown the the user using a device pixel ratio of 2, the buttons looked zoomed in.
This doesn't occur when screenshotting the full page because we set the device pixel ratio to 1.
Also devices that have a device pixel ratio of 1, would not be affected which is why I wasn't able to reproduce on Windows or Linux.

Flags: needinfo?(nbaumgardner)

(In reply to Niklas Baumgardner [:niklas] from comment #5)

I found that is bug is occurring because of Fission. With Fission disabled, the screenshot is expected. With Fission enabled, the screenshot is zoomed in as shown above.

Can you figure out where this is getting lost? Is the devicePixelRatio correct at https://searchfox.org/mozilla-central/source/browser/extensions/screenshots/selector/shooter.js#55

And when we receive that data at: https://searchfox.org/mozilla-central/source/browser/extensions/screenshots/background/takeshot.js#24

Its not clear to me why Fission would affect this, assuming we are able to pass data between processes at all.

Flags: needinfo?(nbaumgardner)

(In reply to Sam Foster [:sfoster] (he/him) from comment #6)

Can you figure out where this is getting lost? Is the devicePixelRatio correct at https://searchfox.org/mozilla-central/source/browser/extensions/screenshots/selector/shooter.js#55

And when we receive that data at: https://searchfox.org/mozilla-central/source/browser/extensions/screenshots/background/takeshot.js#24

Its not clear to me why Fission would affect this, assuming we are able to pass data between processes at all.

While debugging on mac I got the correct devicePixelRatio of 2 in both places.
The only content that is zoomed is the content within the iframe. The content outside of the iframe is shown in the screenshot as expected so it kind of makes sense that the devicePixelRatio is the correct value because if the devicePixelRatio was incorrect, then the whole image would be zoomed.

Flags: needinfo?(nbaumgardner)

So our hypothesis here is that drawSnapshot is not using the correct devicePixelRatio or scaling/pixel density for the iframe when Fission is enabled. Does that sound at all plausible :mstange? The top origin is https://mozilla-hub.atlassian.net, whereas the iframe's document is from https://checkout.mumosystems.com. I can confirm in the debugger that scale * zoom is 2 at https://searchfox.org/mozilla-central/rev/25997ce8267ec9e3ea4b727e0973bd9ef02bba79/toolkit/components/extensions/parent/ext-tabs-base.js#111, but the result clearly shows the 2 documents are being treated quite differently.

Flags: needinfo?(mstange.moz)

:cpeterson, this appear to be fission-related, can you redirect or tag it so it gets in front of the right person?

Flags: needinfo?(cpeterson)

(In reply to Sam Foster [:sfoster] (he/him) from comment #9)

:cpeterson, this appear to be fission-related, can you redirect or tag it so it gets in front of the right person?

I'll tag this bug as caused by Fission, but now that Fission is enabled by default, feature bugs caused by Fission are the responsibility of that feature's dev team.

Bug 1737579 is a related (and possibly duplicate) issue with Fission screenshots of an embedded YouTube video, but it also involves custom zoom levels.

Blocks: fission
Flags: needinfo?(cpeterson)
Summary: Scaling in screenshot incorrect → iframe scaling in screenshot is incorrect with Fission
Whiteboard: [fission]

Miko, could you take a look?

Flags: needinfo?(mstange.moz) → needinfo?(mikokm)

Bug 1750026 is a possible dupe, seems to share some of the same characteristics

No longer blocks: fission, 1753269
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(mikokm)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: