I just got a x86 tablet, and it works great with GNOME(Wayland), having pretty good touch support, except for on Firefox. I can't get multi-touch gestures to work, nor touch scrolling. I've tried environment variables(MOZ_ENABLE_WAYLAND=1,MOZ_USE_XINPUT2=1), but that didn't change anything. I've also had a look in about:config and couldn't tell what options would change my experience. It should be noted that I have WebGL disabled, but I don't forsee that changing anything. I also see under about:support that the Window Protocol is xwayland, and I'm wondering if that changed anything aswell(the protocol doesn't change even with environment variables).
Does anyone have an idea about what's gone wrong with my browser? Thank you very much!
Firefox should default to Wayland starting with version 121, this should not be needed. If you are using a flatpak for Firefox, I suggest you install Flatseal and check it it has the Wayland session toggled off. From there you should also be able to set environment variables specific to this flatpak app.
It looks like you're on the right track — Firefox is running under xwayland rather than Wayland. I had this problem with one of my devices too, but it was fixed by setting the two environment variables you mention and possibly a third, MOZ_USE_WAYLAND.
I'd start by confirming those variables work by executing Firefox with them one-shot:
If that works, stick them in /etc/environment or /etc/profile (or ~/.profile), restart your session, confirm they're set (eg, echo $MOZ_ENABLE_WAYLAND) and you should be good to go.
If they don't work, I'd start exploring what's preventing Firefox from running natively under Wayland.