From 31bdf06d8fbc7004b1805b70b23db23ebfd92ce6 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 22 Sep 2005 21:52:12 +0200 Subject: [PATCH] More detailed element*.linebreak description --- src/document/html/parser.h | 2 ++ src/document/html/parser/parse.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/document/html/parser.h b/src/document/html/parser.h index 88db5b57..f177b3e5 100644 --- a/src/document/html/parser.h +++ b/src/document/html/parser.h @@ -131,6 +131,8 @@ struct html_element { unsigned char *name; int namelen; unsigned char *options; + /* See document/html/parser/parse.c's element_info.linebreak + * description. */ int linebreak; struct frameset_desc *frameset; diff --git a/src/document/html/parser/parse.c b/src/document/html/parser/parse.c index b4859701..8f1ef7e0 100644 --- a/src/document/html/parser/parse.c +++ b/src/document/html/parser/parse.c @@ -404,10 +404,16 @@ struct element_info { * in start_element() (which is also where we call these handlers). */ element_handler_T *func; - /* Basically something like how many line-breaks to put before - * (and sometimes after) an element. Also, for various element closing - * precedence heuristics, a value of zero signifies an inline element - * and a non-zero value indicates a block element. */ + /* How many line-breaks to ensure we have before and after an element. + * Value of 1 means the element will be on a line on its own, value + * of 2 means that it will also have empty lines before and after. + * Note that this does not add up - it just ensures that there is + * at least so many linebreaks, but does not add more if that is the + * case. Therefore, something like e.g.

will add only two + * linebreaks, not four. */ + /* In some stack killing logic, we use some weird heuristic based on + * whether an element is block or inline. That is determined from + * whether this attribute is zero on non-zero. */ int linebreak; enum element_type type; -- 2.11.4.GIT