Improve base path handling in HTML5.