From 7bbf2a9ca0cd418f64b001b87f77c779433119fe Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 26 Apr 2017 16:39:11 +0100 Subject: HTML layout: Extend :after pseudo element handling to cover display:table. This is used in a common clearfix variant. http://nicolasgallagher.com/micro-clearfix-hack/ --- render/box_construct.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index f2d041385..d0ffd9d83 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -594,6 +594,7 @@ static void box_construct_generate(dom_node *n, html_content *content, struct box *box, const css_computed_style *style) { struct box *gen = NULL; + enum css_display_e computed_display; const css_computed_content_item *c_item; /* Nothing to generate if the parent box is not a block */ @@ -611,8 +612,10 @@ static void box_construct_generate(dom_node *n, html_content *content, } /* create box for this element */ - if (css_computed_display(style, box_is_root(n)) == CSS_DISPLAY_BLOCK) { - /* currently only support block level elements */ + computed_display = css_computed_display(style, box_is_root(n)); + if (computed_display == CSS_DISPLAY_BLOCK || + computed_display == CSS_DISPLAY_TABLE) { + /* currently only support block level boxes */ /** \todo Not wise to drop const from the computed style */ gen = box_create(NULL, (css_computed_style *) style, -- cgit v1.2.3