1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
Commit Graph

584 Commits

Author SHA1 Message Date
Jonas Fonseca
8d30613a7f The child node list can be NULL when matching for the :empty pseudo-class
Also use the children node list and not the attribute list (aka the map).
2005-12-23 01:03:39 +01:00
Jonas Fonseca
3ea1b30fd6 Fix matching of the :root structural pseudo-class
Root nodes either have no parents or are the single child of the document
node.
2005-12-23 00:59:56 +01:00
Jonas Fonseca
755108cf95 Tidyup 2005-12-23 00:53:31 +01:00
Jonas Fonseca
4d6223f6a4 Oops, compile fix 2005-12-23 00:52:52 +01:00
Jonas Fonseca
12d34fd133 Factor out code to new match_element_selector()
'Twill make it easier to do the logic.
2005-12-23 00:51:57 +01:00
Jonas Fonseca
07fc481607 match_attribute_selectors(): Factor out matching of values to own function 2005-12-23 00:11:25 +01:00
Jonas Fonseca
262856273e Drop unused get_dom_node_attributes(), comment get_dom_node_list() 2005-12-22 23:42:23 +01:00
Jonas Fonseca
faa85adf73 dom_select_push_element(): Use dom_node_casecmp() and drop homegrown one 2005-12-22 23:40:11 +01:00
Jonas Fonseca
1f47fabf5e Rename dom_node_cmp() to dom_node_casecmp() and make it public 2005-12-22 23:37:59 +01:00
Jonas Fonseca
b13a21bbc2 dom_node_cmp(): Make it into a general node comparer 2005-12-22 23:35:17 +01:00
Jonas Fonseca
6dfd7a5988 When searching DOM node lists store the subtype in the search struct's node 2005-12-22 23:29:07 +01:00
Jonas Fonseca
558e2736e4 search_dom_stack(): Use dom_string_casecmp() for comparison 2005-12-22 22:28:38 +01:00
Jonas Fonseca
c4a1031b2e Move code for the final source highlight flushing to document pop callback
This requires the document root stack state is made mutable and is popped.
Should make render_dom_document() more generalised. For SGML_PARSER_STREAM
this has the fun property that the stack will magically free the root node.
2005-12-22 12:33:27 +01:00
Jonas Fonseca
6f3f859578 parse_sgml(): After parsing pop the stack back to the depth it was before 2005-12-22 12:28:22 +01:00
Jonas Fonseca
4eae1d4882 Add a few comment and remove an obsolete one 2005-12-22 04:00:55 +01:00
Jonas Fonseca
9c720c2cc8 Rename the DOM tree renderer to DOM stack tracer
Use add_dom_stack_tracer(stack) to have stack activity traced. It is only
active when DOM_STACK_TRACE is defined.
2005-12-22 03:55:55 +01:00
Jonas Fonseca
cb64068712 Make it so that the indent string used by the tree renderer needs no init 2005-12-22 03:33:56 +01:00
Jonas Fonseca
f21fcd132f Oops, do not define DOM_TREE_RENDERER by default 2005-12-22 03:21:52 +01:00
Jonas Fonseca
6cb9a841b6 Add FIXME about optimizing walk_dom_nodes() 2005-12-22 03:20:11 +01:00
Jonas Fonseca
eab6c19bbe Add lots of comments and FIXMEs 2005-12-22 03:19:53 +01:00
Jonas Fonseca
bd5d53a2a2 Use get_opt_codepage_tree() 2005-12-22 00:03:30 +01:00
Jonas Fonseca
25e0a18b7f Misc DOM select fixes
- ensure done_dom_stack() is called after parsing is done
 - get_dom_select_data(): Use stack->current->data since it is used within
   dom_stack_callback_T
 - dom_select_pop_element(): Use stack->contexts since it is the
   select_data stack and it owns the first context
 - add the select_data context to the right stack
 - fix some comments
2005-12-21 23:26:22 +01:00
Jonas Fonseca
45592ea5a7 Make the DOM tree renderer thing usable without a dom_renderer defined
It now hardcodes the codepage to ASCII when showing entity references.
The tree debug context info is also exported.
2005-12-21 22:32:27 +01:00
Jonas Fonseca
d6c5640f29 Turn the DOM tree renderer into a debug module
Define DOM_TREE_RENDERER and run as:

	ELINKS_LOG=/tmp/dom-dump.txt ./elinks -no-connect <url>

to have a trace of DOM tree dumped into a file.
2005-12-21 14:41:28 +01:00
Jonas Fonseca
fe6637dd7d Fix the DOM tree renderer to work with the new stack interface 2005-12-21 14:05:01 +01:00
Jonas Fonseca
419d9d165a get_dom_stack_state_data(): Make static inline and handle zero object size 2005-12-21 13:56:18 +01:00
Jonas Fonseca
9360f88d65 search_dom_stack(): No need to inline this at least not while debugging 2005-12-21 13:48:37 +01:00
Jonas Fonseca
779a8a4553 Improve comments 2005-12-21 13:46:28 +01:00
Jonas Fonseca
edee14699e Reorder some struct and fix some comments 2005-12-21 04:57:25 +01:00
Jonas Fonseca
2a24ad9099 Introduce enum dom_stack_flag to make init_dom_stack() more obvious 2005-12-21 04:48:50 +01:00
Jonas Fonseca
632f12f82a init_dom_stack(): Drop unused object_size argument 2005-12-21 04:41:35 +01:00
Jonas Fonseca
f8d48e81eb Move the state_objects to the DOM stack contexts
This way all contexts are now separated, almost.
2005-12-21 04:38:04 +01:00
Jonas Fonseca
910c51abaf Remove the now unused DOM stack data member 2005-12-21 03:59:46 +01:00
Jonas Fonseca
da33827771 Use a (for now bogus) DOM stack context for holding DOM select data 2005-12-21 03:57:17 +01:00
Jonas Fonseca
225e3a6764 Use a (for now bogus) DOM stack context for holding the SGML parser data 2005-12-21 03:39:17 +01:00
Jonas Fonseca
87d8c890dd Define convinience macros for getting parser and parser states from stack 2005-12-21 03:12:35 +01:00
Jonas Fonseca
3374f3cbba Drop data member from struct sgml_parser it is at stack->current->data 2005-12-21 01:36:47 +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
f632b2dfa4 Remove --no-print-directory flag for the recursive make command
... it doesn't do the right thing for me w.r.t. resolving compile errors
to file positions in vim.
2005-12-20 23:21:08 +01:00
Miciah Dashiel Butler Masters
f6ce6c84f7 Rename get_cache_entry_object to smjs_get_cache_entry_object for great
consistency.
2005-12-20 22:13:29 +00:00
Miciah Dashiel Butler Masters
9e15d09340 NULL-terminate cache_entry_props. This and the last change resolves
crashes with GCC 2.x and 3.x reported by zas.
2005-12-20 22:10:59 +00:00
Miciah Dashiel Butler Masters
bb4f08172b In init_smjs, mark global_class static. 2005-12-20 22:09:56 +00:00
Miciah Dashiel Butler Masters
5aaf1101e1 When checking the GCC version, use $CC instead of just gcc so that we
get the right version if the user sets CC.
2005-12-20 21:44:15 +00:00
Jonas Fonseca
5f9583579e And the SGML parser should not add any callbacks anymore 2005-12-20 21:12:25 +01:00
Jonas Fonseca
0834e77252 Make the DOM renderer add its own DOM stack callbacks 2005-12-20 21:10:09 +01:00
Jonas Fonseca
1228ef8d48 Create the SGML parser->root node on demand
This way all callbacks added after init_sgml_parser() will have their
document node push callback invoked.
2005-12-20 21:08:47 +01:00