summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-04-25 14:57:36 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-04-25 14:57:36 +0000
commit7e28ca26d117efb24a5ecc2ba6b12f0d1c2eae16 (patch)
tree99c8137314b747217165e2957f526fe2fbd92a8c
parent4110152a62399381f55fcabe608f4150b36efe38 (diff)
downloadnetsurf-7e28ca26d117efb24a5ecc2ba6b12f0d1c2eae16.tar.gz
netsurf-7e28ca26d117efb24a5ecc2ba6b12f0d1c2eae16.tar.bz2
Accomodate text area scrollbars in fixed widths. Fix radio button / checkbox issue.
svn path=/trunk/netsurf/; revision=4108
-rw-r--r--render/layout.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/render/layout.c b/render/layout.c
index fdb4728a4..e93c41a5d 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -502,9 +502,9 @@ void layout_minmax_block(struct box *block)
if (block->gadget && (block->gadget->type == GADGET_TEXTBOX ||
block->gadget->type == GADGET_PASSWORD ||
block->gadget->type == GADGET_FILE ||
- block->gadget->type == GADGET_TEXTAREA)) {
- assert(block->style);
-
+ block->gadget->type == GADGET_TEXTAREA) &&
+ block->style &&
+ block->style->width.width == CSS_WIDTH_AUTO) {
min = max = css_len2px(&size, block->style);
}
@@ -826,6 +826,8 @@ void layout_float_find_dimensions(int available_width,
if (width == AUTO) {
size.value = 10;
width = css_len2px(&size, box->style);
+ } else {
+ width -= scrollbar_width;
}
if (height == AUTO) {
size.value = 4;
@@ -1786,6 +1788,9 @@ struct box *layout_minmax_line(struct box *first,
float frac;
size_t i, j;
struct box *b;
+ struct css_length gadget_size; /* Checkbox / radio buttons */
+ gadget_size.unit = CSS_UNIT_EM;
+ gadget_size.value = 1;
/* corresponds to the pass 1 loop in layout_line() */
for (b = first; b; b = b->next) {
@@ -1954,7 +1959,7 @@ struct box *layout_minmax_line(struct box *first,
} else {
/* form control with no object */
if (width == AUTO)
- width = 0;
+ width = css_len2px(&gadget_size, b->style);
}
if (min < width)