1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00
Commit Graph

24 Commits

Author SHA1 Message Date
Jonas Fonseca
910c51abaf Remove the now unused DOM stack data member 2005-12-21 03:59:46 +01:00
Jonas Fonseca
c524655362 Add current member to struct dom_Stack which holds the current context 2005-12-21 01:32:43 +01:00
Jonas Fonseca
0faa8d7462 Add a data member to struct dom_stack_context (not used yet) 2005-12-21 01:25:50 +01:00
Jonas Fonseca
12a2f96920 Introduce struct dom_Stack_context
- For now it just stores the dom_stack_context_info reference.
 - Rename dom_stack members to contexts and contexts_size.
 - Use mem_alloc_align based rellocation scheme.
2005-12-21 01:15:19 +01:00
Jonas Fonseca
a77242738c Rename: add_dom_stack_callbacks() -> add_dom_stack_context() 2005-12-21 01:04:37 +01:00
Jonas Fonseca
3843be25af Rename: struct dom_stack_callbacks -> struct dom_stack_context_info 2005-12-21 00:58:22 +01:00
Jonas Fonseca
625725f0e9 Allow for multiple callbacks to be attached to the DOM stack 2005-12-20 20:27:20 +01:00
Jonas Fonseca
e309de8950 Introduce call_dom_stack_callbacks as a common way to call back 2005-12-20 20:01:18 +01:00
Jonas Fonseca
d6b125fa68 Drop the return value from dom_stack_callback_T
... since the feature with popping the node if the return value is NULL is
not used and it doesn't make a lot of sense with multiple callbacks.
2005-12-20 19:48:33 +01:00
Jonas Fonseca
990c5e0a26 Combine DOM stack push and pop callbacks into one struct 2005-12-20 19:20:04 +01:00
Jonas Fonseca
330c0174e5 Rename DOM stack iterators and make them include all states when iterating
They are now called: foreach{back,}_dom_stack_state (...) and the immutable
flag together with node type restricted stack searches should ensure that
the document root node never is popped.
2005-12-19 02:51:32 +01:00
Jonas Fonseca
051db70dd4 Add boolean immutable flag to the DOM stack state
Can be used to ensure the document root node never leaves the stack while
parsing.
2005-12-19 02:34:26 +01:00
Jonas Fonseca
ee1eba9689 Rename: dom_stack_has_parents() -> dom_stack_is_empty() (with negated value) 2005-12-19 02:15:36 +01:00
Jonas Fonseca
bc338207e7 do_pop_dom_node(): move dom_stack_has_parents() to assertion
All callers already checks if the stack is empty.
2005-12-19 02:05:43 +01:00
Jonas Fonseca
45861c68e1 pop_dom_state(): Drop unused left-over argument 2005-12-15 22:05:30 +01:00
Jonas Fonseca
27116d6385 Make the DOM stack and the SGML parser interface more general
They now both hold a single private data member. This means the parser now
holds the renderer data.
2005-12-12 17:41:09 +01:00
Jonas Fonseca
87aad88c96 Use dom_string throughout the DOM stack interface 2005-12-10 21:42:49 +01:00
Jonas Fonseca
4480a9a4cd Removes node from the DOM tree when using the SGML stream parser
That should free up some short-term memory.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
2005-12-08 03:02:27 +01:00
Jonas Fonseca
c7ad6f967b Introduce new pop_dom_state()
It's basically pop_dom_nodes() without the search part and is now used as a
backend in pop_dom_nodes(). Use it in parse_sgml_document() to avoid two
DOM stack searches in a row.
2005-12-05 19:40:35 +01:00
Jonas Fonseca
9aebb66bce Introduce separate push/pop callbacks
This should make it possible to do the SAX (parser stream thing) for XBEL.
And will also be used for fixing the end-tag highlighting.
2005-12-05 19:31:42 +01:00
Jonas Fonseca
65b504f093 Remove all traces of the element end-tag hilighting hack
End-tags will stay uncolored for the next few commits.
2005-12-05 11:21:08 +01:00
Jonas Fonseca
8f25d73013 Use separate data variables for storing DOM stack data
They will eventually have to share the stack.
2005-12-05 11:16:05 +01:00
Jonas Fonseca
208515c82f Fix access to free()d memory in the DOM stack state data
There already was one work-around in the code related to clearing of the
state data after popping. Instead of storing a pointer to the state data in
the state we now store the depth of the state (in the stack) and use a
macro to access the state data. The bug occurred when reallocating the
stack state objects and the stack data pointers wasn't updated to point to
the newly allocated data.
2005-12-05 11:11:06 +01:00
Jonas Fonseca
bccfbf8647 Rename DOM navigator -> stack
This is really a much more appropriate word since it never ended up being
more than just a stack. The rename also changes the symbol names to use the
much shorter "stack".
2005-11-15 10:43:52 +01:00