The rhino js engine which htmlunit uses is most definitely the root cause of these issues, and I was wondering if it was possible to use something like geckodriver instead while still using htmlunit.
Any help is appreciated.
To make the long story short:
The development team behind is small but active. If you provide a simple test case, there is a good chance to get it fixed.