Throw DOMExceptions where appropriate (fixes #2518).
auto merge of #2519 : Ms2ger/servo/exn, r=jdm