Core: re-introduce createHTMLDocument in parseHTML; Safari 8 left out

Close gh-1505