i note that someone started on an experiment to add javascript functionality: http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/2012-January/002641.html js/window.c ----------- this sooo seriously needs to be auto-generated, it's so not true :) the implications are: * you need to pick some middleware. don't for god's sake write your own. tangramCOM would be a good choice [google it]: it's a stand-alone implementation of DCOM [look it up on wikipedia]. * you need some IDL files. i'd recommend just nicking either the webkit ones or the xulrunner ones, and #ifdef'ing everything you're not using. don't for god's sake write your own. * the middleware-auto-generated functions need to have actual real functions which are exactly the same spec as those specified in the IDL file. browser_window_create is no good: it has to be "browser_window_open", where "browser_" is a common prefix for all netsurf functions; window is the name of the IDL file and "open" is the name of the function. then the arguments have to be exactly the same. when i say "don't for god's sake write your own middleware and IDL compiler", i really fracking mean it. the mozilla foundation has the resources to do that kind of thing. you don't. the webkit team has the resources to bumble along creating their own pseudo-IDL compiler (in perl for god's sake). yes i've made the mistake of hand-writing code that should have been written using auto-generators. for one project - the samba-tng project - i got up to 100,000 lines of code over a 3 year period before i stopped, and became an instant convert to FreeDCE. even the samba team haven't got the resources to write a proper IDL compiler (the one they made is half-baked). 10 years on from those lessons even *i* haven't written an IDL compiler: i just nicked other peoples' :) so, for the pythonwebkit project, having seen how awkward the webkit "proper" IDL compiler is, i took the firefox IDL compiler (xpcom.py), bludgeoned it into shape to understand webkit's IDL files; i took python-gobject and mashed _that_ into shape as a back-end for xpcom.py; then i mashed it even further to spew out pure python c-based module code which understood webkit's data types. surprisingly this wasn't as big a job as it sounds. i think it was about 5 days, and i had the *entire* DOM from webkit covered (20,000 properties, 3,000 functions and 300 objects). so. nick XPCOM, nick tangramCOM, nick _anything_ but for god's sake don't write your own IDL compiler tool, you've got better things to do with your lives. render/box.c ------------------ adding js_onclick etc - this _has_ to be generic. again, suitable for talking any kind of event(s) that are auto-generated. render/html_interaction.c --------------------------- again: the on_click - generic. just a callback that goes and "does something" which haaapppens to call into js_exec *not* calling js_exec directly.