Implemented Document#inputEncoding

Resolves #4252
auto merge of #4270 : ProgramFOX/servo/issue-4252, r=saneyuki

Resolves #4252