These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:05 pm Advanced search

Feedback on HTML5 Web Workers: Workers need access to DOM.

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Feedback on HTML5 Web Workers: Workers need access to DOM.

Postby AndreasRosdal » Sun Oct 10, 2010 8:50 pm

Hello!

I have some feedback on the HTML5 Web Workers spec:

In the current spec, Web Workers have no access to manipulate the DOM. I strongly believe that Web Workers should have access to read, and possibly also write to the DOM. Web Workers need access to the DOM, for threads in Javascript to speed up and be useful in rich HTML5 web applications. Typical Javascript web applications keep a lot of their state in the DOM, and need to access this state to perform computations in web worker threads which manipulate this date, including performing network IO, graphics rendering operations on the HTML5 canvas element, parsing JSON and playing HTML5 audio, all in separate worker threads.

This feeedback is based on experiences that I've got while developing a HTML5 web game, at http://www.freeciv.net/. At the moment, this web application is very limited by CPU resources, and would greatly benefit from performing CPU-intensive operations in different threads. For this web application, it would be useful to have separate threads for the following:
1. Rendering graphics to the Canvas element.
2. Sending AJAX requests over the network, gzipping and parsing JSON packets.
3. Update the HTML user-interface and game-state in the DOM.
4. Playing HTML5 audio, redraw the overview map and other misc tasks.

A source for inspiration for Web Workers could in my opinion be SDL threads, described here: http://www.libsdl.org/intro.en/usingthreads.html. SDL Threads are "able to access memory and file handles used by the rest of the application". Web Workers also need to be able to do this.

Finally, my final feedback is that Internet Explorer 9 needs to support Web Workers also. This is crusial for Web Workers to be of practical use on the web. At the moment, Microsoft hasn't implemented support for it.

I really think that Web Workers will be a good enhancement to the HTML standard eventually. I'm looking forward to your feedback.

Regards,
Andreas Roesdal
AndreasRosdal
<h6>
 
Posts: 2
Joined: Sun Oct 10, 2010 8:28 pm

Postby AndreasRosdal » Mon Oct 11, 2010 5:54 am

Update: I've gotten some feedback that this might not be a good idea. Thanks for the feedback.
AndreasRosdal
<h6>
 
Posts: 2
Joined: Sun Oct 10, 2010 8:28 pm


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest