Core: introduce createHTMLDocument in parseHTML; Safari 8/IE8 left out

Close gh-1506