From 7a6f0c765aa01dbf7dfc21766bd17ee94d88786f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 31 Oct 2015 19:08:48 +0000 Subject: Fix descendant bounding box calcs to work with overflow-{x|y}. --- render/layout.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index a54d324fc..154ff75ae 100644 --- a/render/layout.c +++ b/render/layout.c @@ -5081,27 +5081,27 @@ static void layout_update_descendant_bbox(struct box *box, struct box *child, overflow_y = css_computed_overflow_y(child->style); } - if (child->style == NULL || - (child->style && - overflow_x == CSS_OVERFLOW_VISIBLE && - overflow_y == CSS_OVERFLOW_VISIBLE && - html_object == false)) { + layout_get_box_bbox(child, &child_desc_x0, &child_desc_y0, + &child_desc_x1, &child_desc_y1); + + if (overflow_x == CSS_OVERFLOW_VISIBLE && + html_object == false) { /* get child's descendant bbox relative to box */ - child_desc_x0 = child_x + child->descendant_x0; - child_desc_y0 = child_y + child->descendant_y0; - child_desc_x1 = child_x + child->descendant_x1; - child_desc_y1 = child_y + child->descendant_y1; - } else { + child_desc_x0 = child->descendant_x0; + child_desc_x1 = child->descendant_x1; + } else if (overflow_y == CSS_OVERFLOW_VISIBLE && + html_object == false) { /* child's descendants don't matter; use child's border edge */ - layout_get_box_bbox(child, &child_desc_x0, &child_desc_y0, - &child_desc_x1, &child_desc_y1); /* get the bbox relative to box */ - child_desc_x0 += child_x; - child_desc_y0 += child_y; - child_desc_x1 += child_x; - child_desc_y1 += child_y; + child_desc_y0 = child->descendant_y0; + child_desc_y1 = child->descendant_y1; } + child_desc_x0 += child_x; + child_desc_y0 += child_y; + child_desc_x1 += child_x; + child_desc_y1 += child_y; + /* increase box's descendant bbox to contain descendants */ if (child_desc_x0 < box->descendant_x0) box->descendant_x0 = child_desc_x0; -- cgit v1.2.3