Fix html5-backend logic, #944