Do not support XHR.responseXML in worker globals. Fixes #8931.

This commit is contained in:
Josh Matthews 2016-04-13 13:56:01 -04:00
parent dfb482a2b7
commit dd5e28e0e6
3 changed files with 6 additions and 9 deletions

View file

@ -828,6 +828,12 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
// https://xhr.spec.whatwg.org/#the-responsexml-attribute
fn GetResponseXML(&self) -> Fallible<Option<Root<Document>>> {
// TODO(#2823): Until [Exposed] is implemented, this attribute needs to return null
// explicitly in the worker scope.
if let GlobalRoot::Worker(_) = self.global() {
return Ok(None);
}
match self.response_type.get() {
XMLHttpRequestResponseType::_empty | XMLHttpRequestResponseType::Document => {
// Step 3

View file

@ -1,3 +0,0 @@
[001.html]
type: testharness
expected: CRASH

View file

@ -1,6 +0,0 @@
[002.html]
type: testharness
expected: TIMEOUT
[sync XMLHttpRequest in dedicated worker]
expected: TIMEOUT