#ifndef EL__DOCUMENT_HTML_INTERNAL_H #define EL__DOCUMENT_HTML_INTERNAL_H #include "document/css/stylesheet.h" #include "document/html/parser.h" #include "util/lists.h" #ifdef __cplusplus extern "C" { #endif struct document_options; struct uri; /* For parser/parse.c: */ void process_head(struct html_context *html_context, char *head); void put_chrs(struct html_context *html_context, const char *start, int len); enum html_whitespace_state { /* Either we are starting a new "block" or the last segment of the * current "block" is ending with whitespace and we should eat any * leading whitespace of the next segment passed to put_chrs(). * This prevents HTML whitespace from indenting new blocks by one * or creating two consecutive segments of whitespace in the middle * of a block. */ HTML_SPACE_SUPPRESS, /* Do not do anything special. */ HTML_SPACE_NORMAL, /* We should add a space when we start the next segment if it doesn't * already start with whitespace. This is used in an "x z" * scenario when the parser hits : it renders "x" and sets this, * so that it will then render " z". XXX: Then we could of course * render "x " and set -1. But we test for this value in parse_html() * if we hit an opening tag of an element and potentially * put_chrs(" "). That needs more investigation yet. --pasky */ HTML_SPACE_ADD, }; struct html_context { #ifdef CONFIG_CSS /* The default stylesheet is initially merged into it. When parsing CSS * from