summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-08-30 22:30:43 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-08-30 22:30:43 +0000
commit0de9f41db7ad14d2cb40ed5a660586b6c4bad717 (patch)
tree461f2efc1ec96e1fc92da6ab59df1c582fdbb6b6
parentece31d13589ee9d6d36ace5bd2b8642a95375c7b (diff)
downloadnetsurf-0de9f41db7ad14d2cb40ed5a660586b6c4bad717.tar.gz
netsurf-0de9f41db7ad14d2cb40ed5a660586b6c4bad717.tar.bz2
Fix object descendants and make space for scrollbars if required.
svn path=/trunk/netsurf/; revision=10730
-rw-r--r--render/layout.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c
index 0840c8e7d..6774495b5 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1009,7 +1009,9 @@ void layout_block_add_scrollbar(struct box *box, int which)
overflow = css_computed_overflow(box->style);
- if (overflow == CSS_OVERFLOW_SCROLL || overflow == CSS_OVERFLOW_AUTO) {
+ if (overflow == CSS_OVERFLOW_SCROLL || overflow == CSS_OVERFLOW_AUTO ||
+ (box->object &&
+ content_get_type(box->object) == CONTENT_HTML)) {
/* make space for scrollbars, unless height/width are AUTO */
if (which == BOTTOM && box->height != AUTO &&
(overflow == CSS_OVERFLOW_SCROLL ||
@@ -4496,6 +4498,13 @@ void layout_calculate_descendant_bboxes(struct box *box)
box->descendant_y1 = box->padding[TOP] + box->height +
box->padding[BOTTOM] + box->border[BOTTOM].width;
+ if (box->object && content_get_type(box->object) == CONTENT_HTML) {
+ if (box->descendant_x1 < content_get_width(box->object))
+ box->descendant_x1 = content_get_width(box->object);
+ if (box->descendant_y1 < content_get_height(box->object))
+ box->descendant_y1 = content_get_height(box->object);
+ }
+
if (box->type == BOX_INLINE || box->type == BOX_TEXT)
return;