Opened 13 years ago

Closed 12 years ago

#5880 closed enhancement (wontfix)

[patch-CLA] Allow running dojo on the server with simulated DOM

Reported by: guest Owned by: James Burke
Priority: high Milestone: 1.2
Component: BuildTools Version: 1.0
Keywords: Cc: [email protected]
Blocked By: Blocking:

Description (last modified by James Burke)

This patch adds a new "sojo" (server side dojo?) project.

It's based off some work by John Resig to simulate the DOM in rhino. It's proved to be useful for running unit tests. It's very experimental for other purposes i.e. running some javascript on the server with expensive computation. Maybe there is more practical usage for dojo

Usage example: cd utils/sojo; java -jar ../shrinksafe/custom_rhino.jar

Rhino 1.6 release 7 2007 10 19 js> load('env.js'); js> window.location = 'test.html'; test.html js> var djConfig = {baseUrl: "Z:/OpenAjax/dojo/"}; js> load('Z:/OpenAjax/dojo/dojo.js'); js> dojo.require('dojo._base.html'); [object Object] js> dojo.require('dijit.form.CheckBox?'); [object Object] js> var widget = new dijit.form.CheckBox?({id: "cb", name: "cb"}, dojo.byId("test")); js> print(dojo.body().innerHTML); <div role='presentation' waiRole='presentation' class='dijitReset dijitInline dijitCheckBox' widgetId='cb'><input dojoAttachEvent='onmouseover:_onMous e,onmouseout:_onMouse,onclick:_onClick' id='cb' class='dijitReset dijitCheckBoxInput' value='on' tabindex='0' type='checkbox' dojoAttachPoint='focusNo de' name='cb'/></div><div/>

Attachments (1)

sojo.patch (38.1 KB) - added by guest 13 years ago.
DOM simulation with Rhino

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by guest

Attachment: sojo.patch added

DOM simulation with Rhino

comment:1 Changed 13 years ago by Dustin Machi

In previous versions of dojo we had something similar (fakeDOM). It was removed in 0.9/1.0.

comment:2 Changed 13 years ago by James Burke

Milestone: 1.2

We'll have to be careful from a CLA perspective since this code uses code from John Resig. We probably need to get a CLA from him if we want to include this in the repository. It would also be good to compare with the fakeDOM that was previously in Dojo.

I also wonder how this would compare with using Jaxer. There is a ticket related to it: #5878.

BTW, this code is from Jonathan Bond-Caron, CLA is on file.

comment:3 Changed 12 years ago by James Burke

Description: modified (diff)
Resolution: wontfix
Status: newclosed

Jonathan, I'm going to close this for now. It seems like Jaxer provides a more robust solution if we want to run DOM tests outside a browser. Give a holler if you think otherwise.

Note: See TracTickets for help on using tickets.