diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-07-10 12:27:56 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-07-10 12:27:56 +0100 |
commit | 90231bd4b1b7b6fdb0650b4015d94db12e99d7ad (patch) | |
tree | f428842e78da5445ffd635a0cd4cef9d44ccaf84 | |
parent | 3f45e535397b45a60c696aa68565aca4d76b1f2e (diff) | |
download | netsurf-90231bd4b1b7b6fdb0650b4015d94db12e99d7ad.tar.gz netsurf-90231bd4b1b7b6fdb0650b4015d94db12e99d7ad.tar.bz2 |
Force root element box type to BOX_BLOCK.
-rw-r--r-- | render/box_construct.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index 03e87e81d..37a870243 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -944,6 +944,10 @@ bool box_construct_element(struct box_construct_ctx *ctx, * inline container as if they were not absolutely positioned. * Layout expects and handles this. */ box->type = box_map[CSS_DISPLAY_INLINE_BLOCK]; + } else if (props.node_is_root) { + /* Special case for root element: force it to BLOCK, or the + * rest of the layout will break. */ + box->type = BOX_BLOCK; } else { /* Normal mapping */ box->type = box_map[css_computed_display(box->style, @@ -972,8 +976,9 @@ bool box_construct_element(struct box_construct_ctx *ctx, return false; } - if (box->type == BOX_NONE || css_computed_display(box->style, - props.node_is_root) == CSS_DISPLAY_NONE) { + if (box->type == BOX_NONE || (css_computed_display(box->style, + props.node_is_root) == CSS_DISPLAY_NONE && + props.node_is_root == false)) { css_select_results_destroy(styles); box->styles = NULL; box->style = NULL; |