XHR bugfix 21013

Proposed fix for https://www.w3.org/Bugs/Public/show_bug.cgi?id=21013

(And next time I'll remember to do the git squashy things *before* pushing..promise)