diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-06 22:39:45 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-06 22:39:45 +0000 |
commit | 762e1aad733c4d56edbb85c7b21b0951d8f759f2 (patch) | |
tree | 71305c5b65e055c907be507b6242285842bea72f /render/html_redraw.c | |
parent | 008cdb42d718ed1e1e61c9c16e6aa22bc345d202 (diff) | |
download | netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.gz netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.bz2 |
First pass at getting html forms to use textarea widget.
(Input element types text & password, and textarea element.)
Can edit and submit forms, but there are loads of issues.
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r-- | render/html_redraw.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index e305b7b08..fed5ffdc4 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -41,6 +41,7 @@ #include "desktop/options.h" #include "desktop/print.h" #include "desktop/scrollbar.h" +#include "desktop/textarea.h" #include "image/bitmap.h" #include "render/box.h" #include "render/font.h" @@ -2109,7 +2110,11 @@ bool html_redraw_box(const html_content *html, struct box *box, bg_box->type != BOX_TEXT && bg_box->type != BOX_INLINE_END && (bg_box->type != BOX_INLINE || bg_box->object || - bg_box->flags & IFRAME || box->flags & REPLACE_DIM)) { + bg_box->flags & IFRAME || box->flags & REPLACE_DIM || + (bg_box->gadget != NULL && + (bg_box->gadget->type == GADGET_TEXTAREA || + bg_box->gadget->type == GADGET_TEXTBOX || + bg_box->gadget->type == GADGET_PASSWORD)))) { /* find intersection of clip box and border edge */ struct rect p; p.x0 = x - border_left < r.x0 ? r.x0 : x - border_left; @@ -2154,7 +2159,11 @@ bool html_redraw_box(const html_content *html, struct box *box, if (box->style && box->type != BOX_TEXT && box->type != BOX_INLINE_END && (box->type != BOX_INLINE || box->object || - box->flags & IFRAME || box->flags & REPLACE_DIM) && + box->flags & IFRAME || box->flags & REPLACE_DIM || + (box->gadget != NULL && + (box->gadget->type == GADGET_TEXTAREA || + box->gadget->type == GADGET_TEXTBOX || + box->gadget->type == GADGET_PASSWORD))) && (border_top || border_right || border_bottom || border_left)) { if (!html_redraw_borders(box, x_parent, y_parent, @@ -2398,6 +2407,13 @@ bool html_redraw_box(const html_content *html, struct box *box, current_background_color, ctx)) return false; + } else if (box->gadget && + (box->gadget->type == GADGET_TEXTAREA || + box->gadget->type == GADGET_PASSWORD || + box->gadget->type == GADGET_TEXTBOX)) { + textarea_redraw(box->gadget->data.text.ta, + x, y, current_background_color, &r, ctx); + } else if (box->text) { if (!html_redraw_text_box(html, box, x, y, &r, scale, current_background_color, ctx)) |