summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-09-19 23:36:17 +0000
committerJames Bursa <james@netsurf-browser.org>2003-09-19 23:36:17 +0000
commit4aadb2d013d5d99e2e92d796e097fae8c73e931e (patch)
tree6ed014d63262304f6f7659b9cbcaeeafd734164f /render/box.c
parente526454e67598da9187a92d7fce7ef148e022de2 (diff)
downloadnetsurf-4aadb2d013d5d99e2e92d796e097fae8c73e931e.tar.gz
netsurf-4aadb2d013d5d99e2e92d796e097fae8c73e931e.tar.bz2
[project @ 2003-09-19 23:36:17 by bursa]
Start converting forms to use CSS properly. svn path=/import/netsurf/; revision=305
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/render/box.c b/render/box.c
index c5b63464a..789b49356 100644
--- a/render/box.c
+++ b/render/box.c
@@ -524,6 +524,27 @@ struct css_style * box_get_style(struct content ** stylesheet,
xmlFree(s);
}
+ if (strcmp((const char *) n->name, "input") == 0) {
+ if ((s = (char *) xmlGetProp(n, (const xmlChar *) "size"))) {
+ int size = atoi(s);
+ if (0 < size) {
+ char *type = (char *) xmlGetProp(n, (const xmlChar *) "type");
+ style->width.width = CSS_WIDTH_LENGTH;
+ if (!type || stricmp(type, "text") == 0 ||
+ stricmp(type, "password") == 0)
+ /* in characters for text or password */
+ style->width.value.length.unit = CSS_UNIT_EX;
+ else
+ /* in pixels otherwise */
+ style->width.value.length.unit = CSS_UNIT_PX;
+ style->width.value.length.value = size;
+ if (type)
+ xmlFree(type);
+ }
+ xmlFree(s);
+ }
+ }
+
if (strcmp((const char *) n->name, "body") == 0) {
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "text"))) {
unsigned int r, g, b;
@@ -773,6 +794,7 @@ struct result box_input(xmlNode *n, struct status *status,
if (type == 0 || stricmp(type, "text") == 0)
{
box = box_create(style, NULL, 0);
+ box->font = font_open(status->content->data.html.fonts, style);
box->gadget = gadget = xcalloc(1, sizeof(struct gui_gadget));
gadget->type = GADGET_TEXTBOX;
@@ -801,6 +823,7 @@ struct result box_input(xmlNode *n, struct status *status,
else if (stricmp(type, "password") == 0)
{
box = box_create(style, NULL, 0);
+ box->font = font_open(status->content->data.html.fonts, style);
box->gadget = gadget = xcalloc(1, sizeof(struct gui_gadget));
gadget->type = GADGET_PASSWORD;