W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Limited DOM in Web Workers

From: Jack Coulter <jscinoz@jscinoz.org>
Date: Sat, 08 Jan 2011 06:29:12 +1100
To: public-webapps <public-webapps@w3.org>
Message-Id: <1294427825-sup-2624@jscinoz.org>

I have a proposal of sorts, regarding Workers. As we all know, there's no
access to the DOM from within a Web Worker. While this is ideal for security
purposes, I can't help but think a restricted subset of the available DOM
manipulation methods would be incredibly useful.

I'm not talking about allowing Worker's to manipulate the main DOM tree of
the page, but rather, exposing DOMParser, and XMLHttpRequest.responseXML,
and a few other objects to workers, to allow the manipulation of DOM trees
which are never actually rendered to the page.

This would allow developers to parse and manipulate XML in workers, freeing
the main thread of a page to perform other tasks.

A possible counter argument, may be "Why not just use JSON instead?", and
while I agree that JSON is the easiest method of serialising and parsing
objects, sometimes developers must work with data from a source which
only provides XML.

An example of a use-case, I'd like to hack on the Strope.js XMPP
implementation to allow it to run in a worker thread, currently this is
impossible, without writing my own XML parser, which would undoubtedly
be slower than the native DOMParser)

Any thoughts?

Jack Coulter
Received on Friday, 7 January 2011 22:57:52 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:29 UTC