Pressing the Alt key and releasing it again makes Firefox display its menu bar, which makes the interface jump around. Tested with Firefox 70 on Windows 10 and Fedora 30.
Upstream report: https://bugzilla.mozilla.org/show_bug.cgi?id=1574057
This seems to have been fixed upstream. Tested Firefox 133 on Fedora 40. Closing.