Jonas Fonseca
86c9a37810
Factor out dom_string_casecmp()
2005-12-10 21:49:33 +01:00
Jonas Fonseca
87aad88c96
Use dom_string throughout the DOM stack interface
2005-12-10 21:42:49 +01:00
Jonas Fonseca
0fab644bee
get_dom_node_value(): move non-compliant functionality to the tree renderer
...
Entity references are supposed to have a null value and the string
compression is for improving the tree view.
2005-12-10 21:37:47 +01:00
Jonas Fonseca
52f5276f92
get_dom_node_name(): indent switch statement
2005-12-10 20:05:01 +01:00
Jonas Fonseca
295679a5e6
get_dom_node_name(): return struct dom_string *
...
Also, simplify the rendering a bit for now.
2005-12-10 20:03:43 +01:00
Jonas Fonseca
7d6db6b152
Update the DOM tree renderer to support dom_strings
2005-12-10 19:44:01 +01:00
Jonas Fonseca
2aedeb0a67
get_dom_node_type_name(): return struct dom_string *
2005-12-10 19:28:37 +01:00
Jonas Fonseca
5f69255cbc
get_dom_node_map_entry(): take name as a dom_string
...
Requires that dom_string->length becomes a size_t.
2005-12-10 19:21:12 +01:00
Jonas Fonseca
0546759b4b
Use struct dom_string for node->proc_instruction.instruction
2005-12-10 18:59:17 +01:00
Jonas Fonseca
9935bf2083
Convert some yet unused strings to use the dom_string struct
...
Also remove the unneeded path member from the dom_node_id_item struct. It
was obsoleted by the addition of dom_node->parent.
2005-12-10 18:51:08 +01:00
Jonas Fonseca
ed7a292966
Use struct dom_string for node->attribute.value
2005-12-10 18:42:54 +01:00
Jonas Fonseca
ce3778c3c0
Add struct dom_string
...
In time it should be used for all strings in the DOM engine.
For now it is just used for node->string.
2005-12-10 18:37:47 +01:00
Miciah Dashiel Butler Masters
f9dea85126
Drop a line that should have been dropped with commit
...
3719e75068
, 'Reduce code redundancy.'
2005-12-10 16:24:54 +00:00
Laurent MONIN
20cb9ad9ee
html_option(): optimize code.
2005-12-08 16:33:37 +01:00
Laurent MONIN
8fe86a1a63
Drop trailing spaces.
2005-12-08 16:27:51 +01:00
Laurent MONIN
3719e75068
Reduce code redundancy.
2005-12-08 16:26:37 +01:00
Laurent MONIN
1f7aa841aa
Simplify tests.
2005-12-08 16:25:22 +01:00
Laurent MONIN
d9f0de82f8
Use closing_tag variable in tests.
2005-12-08 16:22:53 +01:00
Laurent MONIN
37ec65247d
Minor code reordering.
2005-12-08 16:20:13 +01:00
Laurent MONIN
279f2bec93
Goto see instead of se.
2005-12-08 16:19:20 +01:00
Laurent MONIN
a499bf5a61
Introduce closing_tag variable.
2005-12-08 16:16:28 +01:00
Laurent MONIN
ae00f391f2
t_name -> name, t_namelen -> namelen.
2005-12-08 16:13:21 +01:00
Laurent MONIN
5f66f98b66
Prevent useless tests when @namelen is 0.
2005-12-08 16:11:19 +01:00
Jonas Fonseca
8aa078393a
Move dom_node_data union outside the dom_node struct
2005-12-08 03:26:34 +01:00
Jonas Fonseca
45958b773a
Merge with dom-stack-keep-nodes
2005-12-08 03:07:20 +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
8f97dc8403
done_dom_node(): remove the node from all parent lists
...
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
2005-12-08 02:59:40 +01:00
Jonas Fonseca
93fb17ea2a
Indent switch statement
...
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
2005-12-08 02:32:23 +01:00
Jonas Fonseca
ce5bf8c6f8
Fix DOM node list iterators macros
...
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
2005-12-08 02:04:13 +01:00
Jonas Fonseca
1c2f271782
Add parent member to dom_node
...
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
2005-12-08 01:35:48 +01:00
Laurent MONIN
a1284ccd1f
skip_table(): simplify code.
2005-12-07 20:51:09 +01:00
Laurent MONIN
f3838bac5b
parse_table(): cache to_upper() result.
2005-12-07 20:36:07 +01:00
Laurent MONIN
485e16c6c9
parse_table(): optimize code a bit.
2005-12-07 20:32:36 +01:00
Laurent MONIN
53cbf3e3df
parse_table(): introduce a local variable @is_header to cache test result.
2005-12-06 15:38:34 +01:00
Laurent MONIN
90d843e8fc
parse_table(): re-order code.
2005-12-06 15:35:52 +01:00
Laurent MONIN
a00dfbecf9
parse_table(): fix missing goto see.
2005-12-06 15:32:02 +01:00
Laurent MONIN
29a80ce4eb
parse_table(): optimize even more using @closing_tag.
2005-12-06 15:19:44 +01:00
Laurent MONIN
b63dd28500
parse_table(): use strlcasecmp() instead of strncasecmp().
2005-12-06 15:17:56 +01:00
Laurent MONIN
3fe59e8c7a
parse_table(): totally drop @t_name and @t_namelen in favor of @name
...
and @namelen.
2005-12-06 15:15:25 +01:00
Laurent MONIN
975a4251e8
parse_table(): reorder code to optimize even more.
2005-12-06 15:07:49 +01:00
Laurent MONIN
b6c54846ad
parse_table(): reduce code redundancy.
2005-12-06 15:02:45 +01:00
Laurent MONIN
a371f22b22
parse_table(): use intermediate variables to optimize tests.
2005-12-06 14:57:25 +01:00
Jonas Fonseca
b06a8adeac
Move parser root node initialization to init_sgml_parser()
...
... parse_sgml() in theory should be able to be called multiple times.
2005-12-06 12:30:53 +01:00
Jonas Fonseca
69b321cb5b
Replace struct cache_entry member with struct uri member
...
Reduces the number of (unused) dependencies. Also, update the #include
list removing old entries.
2005-12-05 23:47:23 +01:00
Jonas Fonseca
38b8503161
Remove document member from struct sgml_parser
...
The document URI can be accessed from the cache entry.
2005-12-05 23:31:54 +01:00
Jonas Fonseca
1d24d549e4
Merge with dom-parser-stream
2005-12-05 19:41:56 +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
1c4a0d67ce
Restore highlighting of element end-tags
...
... by installing a pop-callback for elements and responding to whatever
the parser has put in the end_token parser state member.
2005-12-05 19:33:15 +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
d7d5fcab4d
Save the end tag token in the SGML parser state
...
... so that the renderer eventually can pick it up and highlight it.
2005-12-05 19:28:23 +01:00
Jonas Fonseca
7a912795e1
Make the parser stream mode work as intended
...
This makes the parser and renderer share the stack, most importantly the
callbacks are now those of the renderer. Disable node attribute rendering
code that worked around the attributes being visited in sorted order.
2005-12-05 19:25:13 +01:00
Jonas Fonseca
2dddf86acc
Initialize the renderer before initializing the parser
...
... so it is ready when/if the parser will push any initial states.
2005-12-05 19:20:48 +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
4c8d871404
Introduce sgml_parser_type for specifying tree and streaming parsers
...
Mostly added for the future, since currently only one parser type is
supported.
2005-12-05 11:19:13 +01:00
Jonas Fonseca
05a61cd16a
Update the DOM stack comment for things to come
2005-12-05 11:16:52 +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
f85b498375
Add FIXME about using DOM node subtypes when searching the DOM stack
2005-12-05 11:11:40 +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
cc416b2234
Prospone pushing of DOM nodes on the stack until they are fully initialized
...
Goes for both attributes and elements.
2005-12-05 10:26:55 +01:00
Laurent MONIN
eb74cdf6f9
html_button(): drop suspect line which has nothing to do with BUTTON
...
html element.
2005-12-05 09:57:54 +01:00
Laurent MONIN
15a7069fea
Move code from html_input() to new html_input_format().
2005-12-04 18:25:23 +01:00
Laurent MONIN
b863b65fbc
html_input(): minor code reordering.
2005-12-04 12:45:42 +01:00
Laurent MONIN
a57c193ad9
html_input(): drop local variable @type, use @fc->type directly.
2005-12-04 12:43:53 +01:00
Laurent MONIN
7a443d0f73
html_input(): re-order type tests a bit.
2005-12-04 12:40:38 +01:00
Laurent MONIN
a5a731a77b
html_input(): increase indentation a bit to drop a goto/label.
2005-12-04 12:38:19 +01:00
Laurent MONIN
1223850567
html_input(): improve the test logic and simplify the code.
2005-12-04 12:35:55 +01:00
Laurent MONIN
e222bb733c
html_button(): improve the logic.
2005-12-04 12:27:22 +01:00
Laurent MONIN
2df9c06c46
Tidy up.
2005-12-04 12:24:39 +01:00
Laurent MONIN
d1f8b8061c
html_form(): prevent useless second test by using else if instead of if.
2005-12-04 12:21:43 +01:00
Laurent MONIN
37b1fcadea
distribute_table_widths(): simplify.
2005-12-01 11:39:39 +01:00
Laurent MONIN
978eff94ad
Move code from format_table() to new distribute_table_widths().
2005-12-01 11:37:08 +01:00
Laurent MONIN
ac01cbba30
draw_table_caption(): reduce indentation level.
2005-12-01 11:33:43 +01:00
Jonas Fonseca
b42c3f5bd2
Merge with git+ssh://pasky/srv/git/elinks.git
2005-11-30 01:28:34 +01:00
Laurent MONIN
40829d3e34
draw_frame_point(): use BORDER_* and enum border_char type, drop a TODO.
2005-11-29 11:21:35 +01:00
Miciah Dashiel Butler Masters
fee63d574a
Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
2005-11-27 19:40:49 +00:00
Jonas Fonseca
3a9cba5695
Split the parser interface up into init, parser and done steps
...
The parser will eventually have to live across parses for incremental
renderering. Also the renderer and parser need to share the DOM stack.
2005-11-27 09:18:40 +01:00
Jonas Fonseca
68404b5bf1
Remove some unused struct decls
2005-11-27 07:21:28 +01:00
Miciah Dashiel Butler Masters
d0eeab5b7e
Merge the special handling in start_element for tables into html_table.
2005-11-26 02:38:12 +00:00
Miciah Dashiel Butler Masters
947ddc4160
In html_table, rename parameter a to attr.
2005-11-26 02:15:00 +00:00
Miciah Dashiel Butler Masters
cf2fcaa84f
Shuffle code so that the do_html_select, do_html_select_multiple, and
...
html_select are together.
2005-11-26 01:50:46 +00:00
Miciah Dashiel Butler Masters
a781cf1894
Give do_html_select return type void instead of int.
2005-11-26 01:47:50 +00:00
Miciah Dashiel Butler Masters
321003a09e
Check for the multiple attribute in html_select rather than in
...
do_html_select.
2005-11-26 01:46:01 +00:00
Miciah Dashiel Butler Masters
c2445f09bd
Factor do_html_select_multiple out of html_select.
2005-11-26 01:43:10 +00:00
Miciah Dashiel Butler Masters
a6a67174af
Drop the html_textarea wrapper for do_html_textarea and rename
...
do_html_textarea to html_textarea.
2005-11-26 01:35:26 +00:00
Miciah Dashiel Butler Masters
a27284611c
Don't export do_html_select.
2005-11-26 01:32:10 +00:00
Miciah Dashiel Butler Masters
683c8722d2
Merge do_html_script into html_script.
2005-11-26 01:23:07 +00:00
Jonas Fonseca
2e18d752fc
Kill suspicious looking empty line
2005-11-25 13:31:07 +01:00
Laurent MONIN
3dd81f003e
Fix trailing whitespaces.
2005-11-25 09:38:32 +01:00
Laurent MONIN
50ffe0f2cd
html_select(): fix compilation bug to recent patch.
2005-11-25 09:32:43 +01:00
Miciah Dashiel Butler Masters
9062c83b51
Let html_select, html_textarea, and html_script call do_html_select,
...
do_html_textarea, and do_html_script directly instead of handling them
specially in start_element.
2005-11-25 01:22:55 +00:00
Miciah Dashiel Butler Masters
08c1cdf9d4
Add parameters unsigned char *html, unsigned char *eof, and unsigned
...
char **end to element_handler_T.
2005-11-25 00:30:13 +00:00
Jonas Fonseca
94e6b2def5
Revert DOM stack member renames and fix compile errors
2005-11-25 00:16:22 +01:00
Jonas Fonseca
60269a7466
One missing sparse warning fix
2005-11-24 21:57:35 +01:00
Jonas Fonseca
7c0b6809b9
HTML_NODE_INFO -> HTML_, HTML_NODE_INF2 -> HTM2_
2005-11-24 13:32:04 +01:00
Jonas Fonseca
b42b098fd4
Remove unused root member of struct dom_renderer
2005-11-15 12:11:48 +01:00
Jonas Fonseca
acf2ec806b
Remove empty lines in start of header files
...
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00
Jonas Fonseca
41941c64d6
Improve the DOM stack structures comments
2005-11-15 11:21:01 +01:00
Jonas Fonseca
16481d7baa
Move DOM exception enum to separate file
...
... and remove it from the dom_stack struct.
2005-11-15 11:01:11 +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
Laurent MONIN
f7bc7c3497
Tidy up.
2005-11-10 15:42:35 +01:00
Laurent MONIN
2beadb8f6b
html_focusable(): use mem_free_set().
2005-11-10 15:38:52 +01:00
Laurent MONIN
29577cad31
html_focusable(): use a local variable to shorten lines.
2005-11-10 15:35:57 +01:00
Laurent MONIN
24a8ff7294
Tidy up, drop a goto.
2005-11-10 10:39:42 +01:00
Laurent MONIN
39015488d3
Optimize type of script matching.
2005-11-02 16:54:24 +01:00
Laurent MONIN
53590ee002
Attempt to match a wider range of types regarding detection of
...
javascript. Only text/javascript type was matched.
2005-11-02 10:38:24 +01:00
Miciah Dashiel Butler Masters
dcbb9cf909
Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
2005-10-24 00:32:42 +00:00
Andrzej Zaborowski
4fe6e19dc6
Fix a memory-corruption bug in the line justification algorithm.
2005-10-24 00:30:36 +00:00
Miciah Dashiel Butler Masters
5ce3f23a2e
In justify_line, rename the variable 'insert' to 'diff'.
2005-10-23 23:30:12 +00:00
Miciah Dashiel Butler Masters
82c4d457d6
Add a boolean option ecmascript.ignore_noscript, default off,
...
that when enabled causes ELinks to ignore any content enclosed
with <noscript> tags.
2005-10-23 21:59:05 +00:00
Laurent MONIN
792e4c4355
html_special(): move va_end() call outside the switch and make variables
...
more local.
2005-10-21 10:15:03 +02:00
Laurent MONIN
728014118d
Since is_drawing_subs_or_sups() macro is only used by put_chars(),
...
defined it in this function.
2005-10-21 09:46:13 +02:00
Laurent MONIN
df065ead80
Remove now useless $Id: lines.
2005-10-21 09:14:07 +02:00
Laurent MONIN
956484cf57
Drop dead commented code and tidy up.
2005-10-20 17:26:22 +02:00
Laurent MONIN
d54f76bec8
Re-order code in a more logical fashion.
2005-10-20 17:23:18 +02:00
Laurent MONIN
2f8ed27eab
No need to initialize @end and @start.
2005-10-20 17:22:15 +02:00
Laurent MONIN
e47f8068d9
Declare variable in inner block.
2005-10-20 17:21:17 +02:00
Laurent MONIN
c17940044c
Move table cache stuff outside local renderer_context.
2005-10-20 17:17:25 +02:00
Laurent MONIN
23f7fc1b78
Move code from new_link() to new init_link_event_hooks().
...
Make code cleaner, and reduce indentation.
2005-10-20 11:43:42 +02:00
Laurent MONIN
d5e6110711
html_special_tag(): reduce indentation.
2005-10-20 11:21:02 +02:00
Laurent MONIN
ca27359131
Cast void * to struct tag *, instead the opposite.
2005-10-20 11:20:13 +02:00
Laurent MONIN
ee476c6eb6
shift_chars(): let it use alloca() if possible (--fastmem mode only).
2005-10-20 11:13:10 +02:00
Laurent MONIN
11564e255c
Trim trailing whitespaces.
2005-10-20 10:09:19 +02:00
Laurent MONIN
6cc441f34a
Introduce set_screen_char_color() and reduce code redundancy.
2005-10-20 10:07:50 +02:00
Jonas Fonseca
c88afeb1c2
path_to_top -> top_builddir
2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6
Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
...
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Laurent MONIN
7392b8c503
Attempt to improve sub/sup rendering. Now 2<sup>2<sup>2</sup></sup> is
...
rendered as 2^2^2 and mixed sub/sup should be rendered in a better way.
A bit hacky though.
2005-10-19 23:11:27 +02:00
Laurent MONIN
9841316755
Use bitfields for on/off flags in struct renderer_context.
2005-10-19 11:56:26 +02:00
Laurent MONIN
65f4cfcb30
Add a field did_superscript to struct renderer_context and use it instead
...
of a local static variable.
2005-10-19 11:49:00 +02:00
Jonas Fonseca
94ed6fa754
Finalize and cleanup the denser Makefile format
...
Convert remaining conditional file building to use
OBJS-$(CONFIG_FOO) += foo.o
one problem with reverse meaining (in util/) fixed with local 'hack'.
Cleanup and remove stuff which is now default targets.
2005-09-28 12:38:17 +02:00
Jonas Fonseca
c76586e6b8
Simplify the conditional building
...
Use the very cool 'VAR-$(CONFIG_FOO) += foo.o' feature instead of the more
verbose current ifeq($(CONFIG_FOO),yes) wrapping.
2005-09-27 22:49:47 +02:00
Jonas Fonseca
68de9e35d3
Automagically link in subdir lib.o files
...
It is a little ugly since I couldn't get $(wildcard) to expand *.o files
so it just checks if there are any *.c files and then link in the lib.o
based on that.
2005-09-27 22:38:00 +02:00
Jonas Fonseca
1efab31581
Simplify building of and linking with directories
...
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.
Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0
Rename targets: *-l -> *-local
2005-09-27 21:11:28 +02:00
Jonas Fonseca
50f4b46616
dom_node_cmp(): Minor optimization
2005-09-27 14:39:40 +02:00
Petr Baudis
ade2ae0a69
Add simple support for the display CSS property
...
display: inline, display: block and display: inline-block (aliased to
inline) is now supported. I hope I didn't break anything. :-)
This makes the new yucky CSS'd slashdot look at least a bit better.
2005-09-22 22:07:33 +02:00
Petr Baudis
31bdf06d8f
More detailed element*.linebreak description
2005-09-22 21:52:12 +02:00
Petr Baudis
7a91098135
Use is_*_element() to determine whether element is block or inline
...
Use that in the stack killing code, where we do some pretty funny checks
and stuff. The decision is based on the linebreak struct attribute,
non-zero for block elements.
2005-09-22 21:44:28 +02:00
Petr Baudis
4e2d48cc93
ELBuildize some more stuff. All for tonight, turn for the Americans.
2005-09-16 05:09:08 +02:00
Petr Baudis
1f0cd14e91
Converted another bunch of submakefiles to ELBuild
2005-09-16 04:07:37 +02:00
Jonas Fonseca
7462f22635
Remove now obsolete .cvsignore files.
2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad
Initial commit of the HEAD branch of the ELinks CVS repository, as of
...
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00