Closed Bug 1560770 Opened 6 years ago Closed 5 years ago

Add-on popups are tiny and unusable with apz.allow_zooming=true

Categories

(Core :: Panning and Zooming, defect, P3)

57 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla72
Tracking Status
firefox71 --- wontfix
firefox72 --- verified

People

(Reporter: yoasif, Assigned: botond)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Attached image zooming.png

STR:

  1. Install uBlock Origin
  2. set apz.allow_zooming=true
  3. restart Firefox
  4. click uBlock Origin icon in toolbar

What happens:

The popup is tiny and unusuable.

Expected result:

Popup should work like when apz.allow_zooming=false.

This has been an issue since at least version 57, based on a quick mozregression check -- at least on my Ubuntu Eoan machine.

Interestingly, if the add-on icon is moved into the overflow menu, the popup will then display properly. FF 68.0.1 on macOS 10.14.5.

Description of the bug:

When apz.allow_zooming is true in about:config, the html body fails to display the Add-on.

Versions of Firefox tested:

  • Firefox Developer Edition 69.0b10 (64-bit)
  • Firefox Stable 68.0.1 (64-bit)

Workarounds:

  • setting apz.allow_zooming back to false restores previous functionality
  • When pinned to overflow menu, the exrension's DOM elements render as expected
Attached file pinch zoom macos bug (obsolete) —
Attachment #9084572 - Attachment is obsolete: true

Botond, do you have any idea what the cause of this might be?

Flags: needinfo?(botond)

I've spent several hours debugging this today, but haven't gotten very far.

I've traced the issue as far as the width and height of the resolved styles of popup's nsSubDocumentFrame being zero. What I'd like to do next is look at the corresponding <iframe> element in the Browser Toolbox and see where its resolved width and height are coming from in the Inspector, but it doesn't look like you can actually look at popup content in the Browser Toolbox (trying to interact with the toolbox causes the popup to close).

Flags: needinfo?(botond)

I was able to trace the issue further, to nsDocumentViewer::GetContentSizeInternal() returning an empty size with desktop zooming enabled.

That in turn is due to this branch being taken in PresShell::ResizeReflow(). We early-exit here and never get to ResizeReflowIgnoreOverride, and therefore never give the popup's content document a chance to tell us the size it wants.

Conceptually, we are trying to give the popup document "as much space as it needs", and so ask it to compute its size without a viewport size as a starting point. However, with desktop zooming we use MobileViewportManager's sizing logic which requires a viewport size as a starting point.

Assignee: nobody → botond

While we could try to tweak MVM's sizing logic, I think the simpler thing to do here is not to use MVM for the popup's content document. After all, we're not going to allow zooming the popup's content, at least not for now.

(In reply to Botond Ballo [:botond] from comment #13)

https://treeherder.mozilla.org/#/jobs?repo=try&tier=1&revision=ce58012882154cc3b38df40fd90789ad92e8aa98

Somehow, I'm managing to leak the world with these patches...

Oh, I'm using an API that expects to be used with getter_AddRefs.

Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f96dbf78c2e1 Don't use MobileViewportManager if we're not using APZ. r=tnikkel
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72

I still see this problem on Mac with 20191022094606 which includes this fix.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Hmm. The fix was broken either during the process of fixing the leaks, or during the subsequent rebase.

GetNearestWidget() requires the frame tree to have been constructed, which
may not be the case at the case UseMobileViewportManager() is called.

Attachment #9103360 - Attachment description: Bug 1560770 - Use GetRootWidget() rather than GetNearestWiget() in UseMobileViewportManager(). r=tnikkel → Bug 1560770 - Use a method of getting the widget in UseMobileViewportManager() than does not require the frame tree to be constructed. r=tnikkel
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92505a6990ee Use a method of getting the widget in UseMobileViewportManager() than does not require the frame tree to be constructed. r=tnikkel
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED

Confirmed issue with 69.0a1 (2019-06-23) on Windows 10.
Fix verified with 72.0b5 on Windows 10, macOS 10.15, Ubuntu 18.04

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

Attachment

General

Creator:
Created:
Updated:
Size: