Have XHR.getResponseHeader() return null in initial ready states.

Follow the XMLHttpRequest specification for getResponseHeader() and
return null if the object is in ready states {UNSENT, OPENED}.

Similarly for getAllResponseHeaders() and returning "" (the empty
string) when in these initial two ready states.

This replaces the older spec behavior of throwing InvalidStateError,
something that no other engines currently do, hence cross-browser
compatibility risk is low.

When reconciling the relevant tests, reworked these to use
js-test-{pre,post}.js instead.

R=tyoshino@chromium.org
BUG=311274

Review URL: https://codereview.chromium.org/46913002

git-svn-id: svn://svn.chromium.org/blink/trunk@160679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
5 files changed
tree: e5edf92e3e588e9ba36f82fadb9003c5e8ceb5e0
  1. third_party/