I would like to test firefox on Wayland, but today there's no option to do it using portage, since there's no wayland use flag for this package. Reading the Firefox Wayland port bug (https://bugzilla.mozilla.org/show_bug.cgi?id=635134#c92) I found that simply by adding --enable-default-toolkit=cairo-gtk3-wayland it's possible to enable wayland as a backend. I tried to see if I could add it by myself in the last firefox ebuild, but the ebuild is quite complex https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firefox-60.0.2.ebuild
Wayland support is no where near complete. We will not add support for it until it is ready to be supported.
In the meantime, you should be able to use the EXTRA_ECONF profile variable to inject the necessary configuration options for your own experimentation -- you should not need to override the ebuilds or eclasses. https://wiki.gentoo.org/wiki/Knowledge_Base:Overriding_environment_variables_per_package Please note though that even this is experimental, and mozilla team cannot guarantee support for this configuration override will remain or continue to work as expected. YMMV.
Ian Stakenvicius, thank you very much for this tip!
*** Bug 659694 has been marked as a duplicate of this bug. ***