This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21650 - Require that XHR is available in workers
Summary: Require that XHR is available in workers
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-10 06:29 UTC by Simon Pieters
Modified: 2014-02-07 16:18 UTC (History)
4 users (show)

See Also:


Attachments

Description Simon Pieters 2013-04-10 06:29:17 UTC
http://xhr.spec.whatwg.org/#interface-xmlhttprequest

This used to be in the worker spec but was removed at some point. The XHR spec needs to say something like

[[
The XMLHttpRequest constructor must be exposed if the JavaScript global environment is a worker environment.
]]

see e.g. http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workernavigator

Similarly for all other interfaces you want to be exposed in workers defined in this spec.
Comment 1 Simon Pieters 2013-04-10 06:38:38 UTC
Hmm, the WorkerNavigator example should probably be used for interfaces, while constructors should use

[[
This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerGlobalScope interface.
]]
see http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#shared-workers-and-the-sharedworker-interface
Comment 2 Anne 2013-04-10 07:49:11 UTC
What does "must be exposed" mean? Is that defined somewhere?
Comment 3 Simon Pieters 2013-04-10 08:17:21 UTC
http://dev.w3.org/2006/webapi/WebIDL/#dfn-expose
Comment 4 Ian 'Hixie' Hickson 2013-04-24 00:11:10 UTC
Note that the HTML side of this is in flux (two checkins today; more possibly in the semi-near future).
Comment 5 Hallvord R. M. Steen 2013-11-08 10:45:33 UTC
I don't quite get why the XHR spec should say that XHR must be available in Workers. Shouldn't rather the Worker spec reference XHR and say that it must be made available?

(There is currently no mention of XHR in http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html except that XMLHttpRequest is used in one of the demo scripts..)
Comment 6 Anne 2013-11-08 22:29:58 UTC
No, we do not want to update the workers specification whenever a new API comes out. Instead, we should embrace workers as a first-class citizen.

This'll be fixed soon once we have the [Global] and [ExposedBy] or whatever we call them annotations.