Re: [whatwg/xhr] Integrate feature policy (#177)

clelland commented on this pull request.



> @@ -1021,6 +1022,13 @@ method must run these steps:
   <p>Otherwise, if the <a>synchronous flag</a> is set, run these substeps:
 
   <ol>
+   <li>
+    <p>If <a>context object</a>'s <a>relevant settings object</a> has a
+    <a>responsible document</a> and it is <em>not</em>
+    <a>allowed to use</a> the <a>Synchronous XMLHttpRequest</a>
+    feature, then run <a>handle response end-of-body</a> for a <a>network
+    error</a> and return.

That would be surprising to developers, I think -- there aren't currently any cases of a NetworkError being thrown during `open()`, since the fetch algorithm isn't called until send(). Since this policy can be imposed on pages which were written before this proposal, it seems that using an existing failure pattern is less likely to result in unforseen behaviour on the page.

I had originally proposed throwing an `InvalidAccessError` during `open()`, to align with the note at https://xhr.spec.whatwg.org/#sync-warning, but the rough consensus at TPAC (I wasn't actually present, this is second-hand) was around emulating a network-layer-error instead.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/pull/177#discussion_r157809016

Received on Tuesday, 19 December 2017 16:42:42 UTC