diff options
author | Vincent Sanders <vince@kyllikki.org> | 2020-04-29 20:37:42 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2020-04-29 20:37:42 +0100 |
commit | e8d0ba15ad4a91b4644cac0095f40bb3246ec509 (patch) | |
tree | 933e479208aec34f88b483b7e63c057d350339a0 /content/handlers/html/box_construct.h | |
parent | a64261c3bdde79d11c86960181f7b8b5255539be (diff) | |
download | netsurf-e8d0ba15ad4a91b4644cac0095f40bb3246ec509.tar.gz netsurf-e8d0ba15ad4a91b4644cac0095f40bb3246ec509.tar.bz2 |
split html box processing code
reduce the module size of the html box handling code by
splitting into smaller sections.
No functional code change.
Diffstat (limited to 'content/handlers/html/box_construct.h')
-rw-r--r-- | content/handlers/html/box_construct.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/content/handlers/html/box_construct.h b/content/handlers/html/box_construct.h index e93f515e4..f4bd119b1 100644 --- a/content/handlers/html/box_construct.h +++ b/content/handlers/html/box_construct.h @@ -19,6 +19,54 @@ /** * \file * HTML Box tree construction interface. + * + * This stage of rendering converts a tree of dom_nodes (produced by libdom) + * to a tree of struct box. The box tree represents the structure of the + * document as given by the CSS display and float properties. + * + * For example, consider the following HTML: + * \code + * <h1>Example Heading</h1> + * <p>Example paragraph <em>with emphasised text</em> etc.</p> \endcode + * + * This would produce approximately the following box tree with default CSS + * rules: + * \code + * BOX_BLOCK (corresponds to h1) + * BOX_INLINE_CONTAINER + * BOX_INLINE "Example Heading" + * BOX_BLOCK (p) + * BOX_INLINE_CONTAINER + * BOX_INLINE "Example paragraph " + * BOX_INLINE "with emphasised text" (em) + * BOX_INLINE "etc." \endcode + * + * Note that the em has been collapsed into the INLINE_CONTAINER. + * + * If these CSS rules were applied: + * \code + * h1 { display: table-cell } + * p { display: table-cell } + * em { float: left; width: 5em } \endcode + * + * then the box tree would instead look like this: + * \code + * BOX_TABLE + * BOX_TABLE_ROW_GROUP + * BOX_TABLE_ROW + * BOX_TABLE_CELL (h1) + * BOX_INLINE_CONTAINER + * BOX_INLINE "Example Heading" + * BOX_TABLE_CELL (p) + * BOX_INLINE_CONTAINER + * BOX_INLINE "Example paragraph " + * BOX_FLOAT_LEFT (em) + * BOX_BLOCK + * BOX_INLINE_CONTAINER + * BOX_INLINE "with emphasised text" + * BOX_INLINE "etc." \endcode + * + * Here implied boxes have been added and a float is present. */ #ifndef NETSURF_HTML_BOX_CONSTRUCT_H |