This way we avoid some of the ifdefs and also get clearer picture of the parser
interface, esp. if internal.h goes away too.
This is basically just renamed dompareser.h which is gone now.
Since we now have multiple parsers, the name "parser" is no longer suitable.
Now the old Mikulas' parser is called "mikuparser". Also, html/parser.* is
renamed to html/mikuparser/mikuparser.*.
Currently living in document/html/dom.*, this aims to be an alternative
for the original Mikulas' HTML parser, using the experimental DOM engine.
It does not aim to replace Mikulas' HTML renderer just yet.
It is shifted into the existing infrastructure pretty uglily now, it will need
more hacking to make this a bit cleaner. But surprisingly, only three files
outside of document/html needed ifdefs, two of them in document/. Nifty!
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.
Normally, you can add some objects or subdirs to the build if some
config variable is set to yes, by doing:
SUBDIRS-$(CONFIG_FOO)
Now you can do it the other way too, including stuff if some
variable is set to no:
SUBDIRS-unless$(CONFIG_FOO)
This will be used for switching between two HTML parser implementations.
...as struct text_style. This way it might be possible later to
add other default formatting attributes by CSS and it allows
quite a code simplification in the DOM renderer.
Currently, all DOM, HTML and plain renderers had their own routine for
conversion from text style to screen attribute. This moves text_style and
text_style_format from html/parser.h to renderer.h and introduces new generic
routine get_screen_chracter_template() that is used by all the specific
rendering engines.
The parsing in parse_set and parse_unset saves, overwrites with a NUL, and restores a character in the string that is being parsed. If there is a malloc failure between overwriting and restoring, the restore is not done. This commit changes that behaviour to restore before returning.
Now, CSS is initialized separately for each of the renderers, so that
also RSS doesn't just choose styles of random DOM node types.
init_template_by_style() is introduced as the common backend for
loading CSS properties.
Introduce get_option_shadow. This routine takes an option, the tree under which that option resides, and another tree. It returns a corresponding option with parallel ancestry in the second tree, creating that option and ancestry if it does not already exist.
Add enum copy_option_flags.
Add the CO_NO_LISTBOX_ITEM flag, which is used to suppress listbox creation for shadowed trees.
Add the CO_SHALLOW flag, which is used to suppress the duplication of unwanted children for shadowed trees.
Add a flags parameter to copy_option and tree_dup (and out of necessity, struct option_type_info and str_dup).