diff options
author | James Bursa <james@netsurf-browser.org> | 2004-10-17 21:10:19 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-10-17 21:10:19 +0000 |
commit | fd4e3de0b59841ca59aeeb1a664370d359d096b2 (patch) | |
tree | 3c174528b81e4a9189ed6aa88ef35d5238c0882b /render/layout.c | |
parent | 6db5ad1b73c3a59390d4e060a3752a09ec75ec44 (diff) | |
download | netsurf-fd4e3de0b59841ca59aeeb1a664370d359d096b2.tar.gz netsurf-fd4e3de0b59841ca59aeeb1a664370d359d096b2.tar.bz2 |
[project @ 2004-10-17 21:10:19 by bursa]
Move box tree from html.layout->children to html.layout. Work on scrollbars.
svn path=/import/netsurf/; revision=1314
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/render/layout.c b/render/layout.c index f7717f0df..a59c23da0 100644 --- a/render/layout.c +++ b/render/layout.c @@ -356,6 +356,12 @@ void layout_block_find_dimensions(int available_width, struct box *box) box->width = layout_solve_width(available_width, width, margin, padding, border); + if (style->overflow == CSS_OVERFLOW_SCROLL) { + /* make space for vertical scrollbar */ + box->width -= SCROLLBAR_WIDTH; + box->padding[RIGHT] += SCROLLBAR_WIDTH; + } + if (box->object && box->object->type == CONTENT_HTML && box->width != box->object->available_width) { content_reformat(box->object, box->width, box->height); @@ -418,6 +424,9 @@ int layout_solve_width(int available_width, int width, void layout_float_find_dimensions(int available_width, struct css_style *style, struct box *box) { + int scrollbar_width = style->overflow == CSS_OVERFLOW_SCROLL ? + SCROLLBAR_WIDTH : 0; + layout_find_dimensions(available_width, style, box->margin, box->padding, box->border); @@ -452,6 +461,8 @@ void layout_float_find_dimensions(int available_width, break; } + box->padding[RIGHT] += scrollbar_width; + if (box->object) { /* floating replaced element, see 10.3.6 and 10.6.2 */ if (box->width == AUTO && box->height == AUTO) { @@ -474,6 +485,8 @@ void layout_float_find_dimensions(int available_width, box->width = box->min_width; if (box->max_width < box->width) box->width = box->max_width; + } else { + box->width -= scrollbar_width; } if (box->margin[TOP] == AUTO) |