[html5] pull request 40 and 41 by limikael (Mikael Lindqvist).