Closed Bug 2012305 Opened 1 day ago Closed 3 hours ago

Popups no longer update position

Categories

(Core :: XUL, defect)

defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox147 --- affected
firefox148 --- affected
firefox149 --- fixed

People

(Reporter: aminomancer, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Popups used to constantly update their position when moving the window they're attached to. They still emit popuppositioned events, but the popup does not actually position. For most of the main chrome UI popups, they at least update position when you stop dragging - not ideal, but at least the popup isn't left permanently hanging. But for OMC's feature callout panels, they never update position. They used to work just fine, and smoothly follow the anchor around the screen. The only things that are special about these panels are the xul attributes and the use of a popuppositioned event listener (which shouldn't do anything except set an attribute on the panel, which is only used by CSS to move the custom arrow).

So the part most confusing to me is distinguishing the feature callout panels from other panels - what makes them different. These popups stay open even when you click outside them. For other popups, you would need to use the disable_autohide pref. But this can still matter for any popup, as the anchor can occasionally move without the user needing to click outside the popup. Anyway, popup movement is rare for the usual popups, but common for feature callouts because autohide is disabled. But I tried removing the noautohide attribute, and it still doesn't update position. behavior Another difference might be that our popup is not created by an event, so there is no triggerEvent param to pass to openPopup. Other popups tend to pass this, so maybe that's significant.

Pushlog

I suspect this was regressed by bug 1933181, but I'm not certain, because the bisection fell apart at the end:

1:40.37 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=860e9251e02806437cda3650e62d5747aaa45895&tochange=69063d81c4e1f54731d4a8698c63c3a703e83966

1:42.64 INFO: ************* Switching to autoland by process of elimination (no branch detected in commit message)
1:43.84 ERROR: Unable to exploit the merge commit. Origin branch is mozilla-central, and the commit message for 69063d81 was:
Bug 1994157 - Partially revert the previous patch to land what emilio intended.

Testing

Our feature callout panels can be easily tested by going to about:config and enabling browser.newtabpage.activity-stream.asrouter.devtoolsEnabled, then going to about:asrouter, searching for "TEST_FEATURE_TOUR", and hitting the blue Show button under it. That will open a feature callout anchored to the app menu button, so it should follow the button around. But if you move the window, it doesn't - at least on Windows. If anyone can test this on another OS that would be great.


I'm CCing @emcminn since she could probably easily test this on macOS, and @emilio since he knows about how the popup code has changed lately.

Flags: needinfo?(emilio)

Set release status flags based on info from the regressing bug 1933181

We don't unconditionally move-resize native windows every frame anymore,
but we still need to schedule a native move resize in cases where the
window moves.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)

So adding an automated test for this should be reasonably easy. Is there an example test that tests this mechanism? It should be possible to move the window with window.moveBy(2, 2) or so and checking that the popup's getOuterScreenRect() also changes.

Flags: needinfo?(shughes)

(In reply to Emilio Cobos Álvarez [:emilio] from comment #3)

So adding an automated test for this should be reasonably easy. Is there an example test that tests this mechanism? It should be possible to move the window with window.moveBy(2, 2) or so and checking that the popup's getOuterScreenRect() also changes.

Not in the feature callout tests. It's just assumed that the panel works as usual. I can file a followup to add a test, though. Seems straightforward enough. The right spot would probably be around here.

Alternatively, it seems like a basic enough mechanism to have its own test like these. test_popup_tracksWindowMoves or something like that.

Flags: needinfo?(shughes)
Status: ASSIGNED → RESOLVED
Closed: 3 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: