summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-10-31 19:08:48 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-10-31 19:11:24 +0000
commit7a6f0c765aa01dbf7dfc21766bd17ee94d88786f (patch)
tree2777d14377b3a938a5fd2cc3492facf9151a55a0 /render
parent43f29e43115665d6b919f38aaae4c6bfa731d71e (diff)
downloadnetsurf-7a6f0c765aa01dbf7dfc21766bd17ee94d88786f.tar.gz
netsurf-7a6f0c765aa01dbf7dfc21766bd17ee94d88786f.tar.bz2
Fix descendant bounding box calcs to work with overflow-{x|y}.
Diffstat (limited to 'render')
-rw-r--r--render/layout.c32
1 files changed, 16 insertions, 16 deletions
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;