summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-11-24 17:22:25 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-11-24 17:22:25 +0000
commit60a9d3af3be35eb3a5f414044a797a21dc77f907 (patch)
treec74c9aba6c1f1596765a0a66befc12c0292f750d /render/layout.c
parent5970157fc7e0d2360e037ff73b1be3ca1454ae85 (diff)
downloadnetsurf-60a9d3af3be35eb3a5f414044a797a21dc77f907.tar.gz
netsurf-60a9d3af3be35eb3a5f414044a797a21dc77f907.tar.bz2
Only make space for vertical box scrollbar if box has height set.
svn path=/trunk/netsurf/; revision=13179
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/render/layout.c b/render/layout.c
index fd9c7f7cf..8d4d50fd7 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1258,12 +1258,18 @@ void layout_block_add_scrollbar(struct box *box, int which)
(box->object && content_get_type(box->object) ==
CONTENT_HTML)) {
/* make space for scrollbars, unless height/width are AUTO */
+ enum css_height_e htype;
+ css_fixed height = 0;
+ css_unit hunit = CSS_UNIT_PX;
+ htype = css_computed_height(box->style, &height, &hunit);
+
if (which == BOTTOM && box->height != AUTO &&
(overflow == CSS_OVERFLOW_SCROLL ||
box_hscrollbar_present(box))) {
box->padding[BOTTOM] += SCROLLBAR_WIDTH;
}
if (which == RIGHT && box->width != AUTO &&
+ htype == CSS_HEIGHT_SET &&
(overflow == CSS_OVERFLOW_SCROLL ||
box_vscrollbar_present(box))) {
box->width -= SCROLLBAR_WIDTH;