diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-21 20:07:14 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-21 20:07:14 +0000 |
commit | 3aeafecd7b547e3f535fb5a700fc20e590dab967 (patch) | |
tree | 3a903ee55002a0d5553bfae7d31adbc028b24897 /render/box.c | |
parent | 423f0f1e7068ba4874435c02e31b054e62ae7966 (diff) | |
download | netsurf-3aeafecd7b547e3f535fb5a700fc20e590dab967.tar.gz netsurf-3aeafecd7b547e3f535fb5a700fc20e590dab967.tar.bz2 |
[project @ 2004-03-21 20:07:14 by jmb]
<input type="file" support>
Broken in places.
svn path=/import/netsurf/; revision=645
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/render/box.c b/render/box.c index 94419c4f8..d694481a1 100644 --- a/render/box.c +++ b/render/box.c @@ -74,7 +74,7 @@ static struct result box_select(xmlNode *n, struct status *status, static struct result box_input(xmlNode *n, struct status *status, struct css_style *style); static struct box *box_input_text(xmlNode *n, struct status *status, - struct css_style *style, bool password); + struct css_style *style, bool password, bool file); static struct result box_button(xmlNode *n, struct status *status, struct css_style *style); static void add_option(xmlNode* n, struct form_control* current_select, char *text); @@ -1036,16 +1036,22 @@ struct result box_input(xmlNode *n, struct status *status, /* the default type is "text" */ if (type == 0 || stricmp(type, "text") == 0) { - box = box_input_text(n, status, style, false); + box = box_input_text(n, status, style, false, false); gadget = box->gadget; gadget->box = box; } else if (stricmp(type, "password") == 0) { - box = box_input_text(n, status, style, true); + box = box_input_text(n, status, style, true, false); gadget = box->gadget; gadget->box = box; } + else if (stricmp(type, "file") == 0) + { + box = box_input_text(n, status, style, false, true); + gadget = box->gadget; + gadget->box = box; + } else if (stricmp(type, "hidden") == 0) { /* no box for hidden inputs */ @@ -1154,7 +1160,7 @@ struct result box_input(xmlNode *n, struct status *status, } struct box *box_input_text(xmlNode *n, struct status *status, - struct css_style *style, bool password) + struct css_style *style, bool password, bool file) { char *s; unsigned int i; @@ -1191,6 +1197,9 @@ struct box *box_input_text(xmlNode *n, struct status *status, inline_box->text = xcalloc(inline_box->length + 1, 1); for (i = 0; i != inline_box->length; i++) inline_box->text[i] = '*'; + } else if (file) { + box->gadget->type = GADGET_FILE; + inline_box->text = xcalloc(inline_box->length + 1, 1); } else { box->gadget->type = GADGET_TEXTBOX; inline_box->text = xstrdup(box->gadget->value); |