I'm working on a project that makes use of V8. For this project I'm not 
using Node, but what I need is probably something people using Node could 
benefit from.

What I need is an efficient light weight "HTML5 DOM pre-processor". 
Basically I need to expose an HTML5 based DOM to V8 without a full browser 
stack. This would provide the "document" object (with getElementById, 
querySelector, etc...), Level 1 DOM (perhaps Level 2), and HTML5 form 
validation (where it can be invoked by JavaScript with something like 
checkValidity). It would _not_ pull external resources (images, css files, 
javascript files, etc...), execute inline JavaScript, compute styles, or 
have events. It would simply be a way to load an HTML document on the 
server into a DOM tree and execute external (basic) JavaScript on it (that 
can be re-used on the client side).

The purpose is to modify the DOM: Remove/add/modify elements. Example: 
Repeating a div, populating form values, and validating input based on the 
fields in the DOM and the set values. You could use querySelector to select 
all the fields in the document and populate them from an external source 
(this does two things: Populates input fields to export to the browser and 
validates incoming input).

I haven't found much in C++ as far as an HTML5 parser goes. The closest 
I've been able to find is validator.nu, which is written in Java - Mozilla 
has a tool that converts this parser into C++. Webkit's parser is also very 
well integrated into the browser. Not sure about Mozilla's implementation, 
but I imagine not as integrated as Webkit. PhantomJS uses webkit, so it has 
a full browser stack. 

I've looked at "user land" solutions such as jsdom. Someone on the jsdom 
mailing lists recommended looking at dom.js. The problem with these 
solutions is they live in the V8 context. This isn't as much of a problem 
for Node.js users since the whole application is based on the V8 context... 
But in my case I'm using a (mostly vanilla) V8 context to execute 
sand-boxed user plugins. I need to be able to throw away a V8 
instance/context and preserve the DOM.

The goal, besides what I've mentioned above, is to create a library that 
isn't specific to Node.js or even V8. Something like "libhtml5 + CSS3 
selectors (non-gui ones) + input validation" that would be more appropriate 
for html than "libxml2 + xpath".

(The library would be tied to V8/Node through bindings).

Is anyone interested in working on such a project?

Luke

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to