[elinks-users] elinks, DOM, and javascript

Yan Seiner yan at seiner.com
Sun Apr 15 07:02:57 PDT 2007

Jonas Fonseca napsal(a):
> Hello Yan,
> Yan Seiner <yan at seiner.com> wrote Fri, Apr 13, 2007:
>> I've been playing with elinks.  It's a great browser and is almost 
>> exactly what I need....
>> Before I dive deep into the code, what is the status of DOM / javascript 
>> implementation?
> For rendering HTML and doing javascript ELinks still uses the original
> HTML engine, which is beginning to show its age. It was written before
> DOM and javascript really caught on so javascript support has kind of
> been "glued on".

I figured this out - AFAICT it's basically been stuck in to handle the 
<a/> element.
> Work was started (a few times actually) to write a new HTML engine but
> neither attempts have resulted in something that can replace the
> original engine. There are some non-trivial stuff like incremental
> loading and of course the problem of making a light-weight but fast
> implementation of DOM. The (recent) DOM engine, however, lives in the
> tree and is used for HTML highlighting (optional feature at build time).
> The DOM parser is mostly done, but the work for the layouter CSS
> rendering part remains untouched.
>> It seems to partially work, but I really, really need to manipulate form 
>> fields with javascript.
> I am not much into the javascript support. I do, however, remember
> seeing work on form manipulation.
>> I build elinks with libsee and none of the javascript seems to work - 
>> not surprising given that it's documented that way.
>> What needs to be done to implement DOM/javascript for forms?
> Since you mention DOM, I guess you are requiring the ability to modify
> the DOM tree by adding fields etc. 
We send a form with a fixed number of fields.  What we need is the 
ability to change the values in several fields based on incoming 
characters, and to toggle visibility of lines in the form.

> ELinks doesn't expose such a thing.
> So it might be a lot of work. On the other hand you don't say exactly
> what you need so I don't want to sound too negative.
What we are working on is the front end to a control system.  The system 
can be controlled via an ordinary web browser via 802.11 or via a small, 
built-in screen.  The built-in screen is 320x240, monochrome, and has a 
minimal keypad - basically, nav buttons (Up, Down, Right, Left), 
Increment/Decrement, and Enter.

Each field stores its properties as attribtutes, so that a field might 
have the following attributes:

Max, Min, Wrap, Inc

We then use Javascript to modify the form entry field.  If the 
Javascript gets an Increment command, it adds the Inc to the field, 
checks for Max value, if it exceeds Max it then either clamps it or 
wraps it to Min, depending on the value of Wrap.

We also toggle visibility of lines in the table, but we could change 
that to scrolling.

The only other thing we do that's a bit complex is insert/delete lines 
in the form - but we're not actually adding or deleting lines, we're 
just copying data from one line to another.  Each form has a fixed 
number of lines.

Could that be done?  If so, what do I need to enable during build time 
to test it?



More information about the elinks-users mailing list