Open Bug 1708304 Opened 4 years ago Updated 3 years ago

browser.windows.create popup hides Windows controls when height is larger than display height

Categories

(WebExtensions :: Untriaged, defect, P3)

Firefox 88
defect

Tracking

(firefox88 affected, firefox89 affected, firefox90 affected)

Tracking Status
firefox88 --- affected
firefox89 --- affected
firefox90 --- affected

People

(Reporter: thexinex, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

On Window 10 in a Firefox extension dev console run the following command:

browser.windows.create({
url: https://mozilla.org,
type: "popup",
width: 500,
height: 12000, // or some arbitrarily large value
left: 450,
focused: true,
})

Actual results:

The resulting popup window appears with the window controls (the title bar and close/minimize buttons) hidden off the top of the screen, making it difficult to move, minimize, or close the popup. Changing the top parameter doesn't seem to affect the placement of the window if the height is very large.

Expected results:

The top of the popup window should appear at the top of the screen so the user can more easily manage the popup window.

The correct behavior happens with the same command in Firefox for Mac.

This bug was discovered in this Github issue: https://github.com/Glench/ExtPay/issues/9

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Product: Firefox → WebExtensions
Flags: needinfo?(mixedpuppy)

Hello,

I reproduced the issue as per the STR on the latest Nightly (90.0a1/20210503214210), Beta (89.0b7/20210502185943) and Release (88.0/20210415204500) only on Windows 10 x64.

The issue cannot be reproduced on Linux (tested with Ubuntu 16.04 LTS)

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image 2021-05-04_10h50_10.png

I'm unable to reproduce this on osx 11.3.

Using the STR with some additional output in updateGeometry, I see that the positioning and sizing is adjusted to the dimensions of my screen.

=== geometry starts with 0 24 1 29
=== geometry is now 450 25 500 949
browser.windows.create({
	url: "https://mozilla.org",
	type: "popup",
	width: 500,
	height: 12000, // or some arbitrarily large value
	left: 450,
	focused: true,
});

Confirmed this on Windows as well, going back at least two years. I tried looking for the implementation, but I got lost in layers before finding anything useful.

Hey Neil, do you happen to know if the platform differences come from our code or something that the OS does? Or maybe who might know more?

Flags: needinfo?(mixedpuppy) → needinfo?(enndeakin)

On Mac, the coordinates we calculate are assigned in nsCocoaWindow::Move and nsCocoaWindow::Resize. The values passed in here specify the position and size we calculate. This would be where to start looking for where this is going wrong.

The coordinates should already be constained to fit in the screen however before this, and this would have been done by nsMenuPopupFrame::GetConstraintRect.

Flags: needinfo?(enndeakin)
Severity: -- → S4
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: