diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-22 15:12:18 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-22 15:12:18 +0000 |
commit | 7f1108df32bb409b6331a1d1f8ba2e22a8a06e9f (patch) | |
tree | 3cd945554ea7cc54a79fffaf23e61c7933d7b73f /render/layout.c | |
parent | 474cbe917ea936b905371cc54162870361c33f0a (diff) | |
download | netsurf-7f1108df32bb409b6331a1d1f8ba2e22a8a06e9f.tar.gz netsurf-7f1108df32bb409b6331a1d1f8ba2e22a8a06e9f.tar.bz2 |
Child's descendant bbox only affects current box's bbox if the child has overflow:visible.
svn path=/trunk/netsurf/; revision=11755
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/render/layout.c b/render/layout.c index 9cf7c4472..ba5178d07 100644 --- a/render/layout.c +++ b/render/layout.c @@ -4520,15 +4520,24 @@ static void layout_get_box_bbox(struct box *box, int *desc_x0, int *desc_y0, static void layout_update_descendant_bbox(struct box *box, struct box *child, int off_x, int off_y) { + int child_desc_x0, child_desc_y0, child_desc_x1, child_desc_y1; + /* get coordinates of child relative to box */ int child_x = child->x - off_x; int child_y = child->y - off_y; - /* get child's descendant bbox relative to box */ - int child_desc_x0 = child_x + child->descendant_x0; - int child_desc_y0 = child_y + child->descendant_y0; - int child_desc_x1 = child_x + child->descendant_x1; - int child_desc_y1 = child_y + child->descendant_y1; + if (child->style && css_computed_overflow(child->style) == + CSS_OVERFLOW_VISIBLE) { + /* 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'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); + } /* increase box's descendant bbox to contain descendants */ if (child_desc_x0 < box->descendant_x0) |