Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/0dbc6e5ecdc3a4ec97fd65876051577e53fc1873
...commit
http://git.netsurf-browser.org/netsurf.git/commit/0dbc6e5ecdc3a4ec97fd65876051577e53fc1873
...tree
http://git.netsurf-browser.org/netsurf.git/tree/0dbc6e5ecdc3a4ec97fd65876051577e53fc1873
The branch, master has been updated
via 0dbc6e5ecdc3a4ec97fd65876051577e53fc1873 (commit)
from 570f2dc03608d525ef02102ff0ca8225d57b40ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=0dbc6e5ecdc3a4ec97fd65876051577e53fc1873
commit 0dbc6e5ecdc3a4ec97fd65876051577e53fc1873
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
fix keypress entry on text area
accidentaly broken in commit fca421e2047a55f3cf575c92943c1116ec58da3c
diff --git a/content/handlers/html/box_textarea.c
b/content/handlers/html/box_textarea.c
index 8b4fdf9..e253e16 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -43,24 +43,32 @@ nserror box_textarea_keypress(html_content *html, struct
box *box, uint32_t key)
struct form_control *gadget = box->gadget;
struct textarea *ta = gadget->data.text.ta;
struct form* form = box->gadget->form;
- struct content *c = (struct content *) html;
+ struct content *c = (struct content *)html;
nserror res = NSERROR_OK;
assert(ta != NULL);
- if (gadget->type != GADGET_TEXTAREA) {
- switch (key) {
- case NS_KEY_NL:
- case NS_KEY_CR:
- if (form) {
- res = form_submit(content_get_url(c),
- html->bw,
- form,
- NULL);
- }
- break;
+ if (gadget->type == GADGET_TEXTAREA) {
+ if (textarea_keypress(ta, key)) {
+ return NSERROR_OK;
+ } else {
+ return NSERROR_INVALID;
+ }
+ }
+
+ /* non textarea input */
+ switch (key) {
+ case NS_KEY_NL:
+ case NS_KEY_CR:
+ if (form) {
+ res = form_submit(content_get_url(c),
+ html->bw,
+ form,
+ NULL);
+ }
+ break;
- case NS_KEY_TAB:
+ case NS_KEY_TAB:
{
struct form_control *next_input;
/* Find next text entry field that is actually
@@ -79,9 +87,9 @@ nserror box_textarea_keypress(html_content *html, struct box
*box, uint32_t key)
textarea_set_caret(next_input->data.text.ta, 0);
}
}
- break;
+ break;
- case NS_KEY_SHIFT_TAB:
+ case NS_KEY_SHIFT_TAB:
{
struct form_control *prev_input;
/* Find previous text entry field that is actually
@@ -100,15 +108,14 @@ nserror box_textarea_keypress(html_content *html, struct
box *box, uint32_t key)
textarea_set_caret(prev_input->data.text.ta, 0);
}
}
- break;
+ break;
- default:
- /* Pass to textarea widget */
- if (!textarea_keypress(ta, key)) {
- res = NSERROR_INVALID;
- }
- break;
+ default:
+ /* Pass to textarea widget */
+ if (!textarea_keypress(ta, key)) {
+ res = NSERROR_INVALID;
}
+ break;
}
return res;
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box_textarea.c | 51 +++++++++++++++++++---------------
1 file changed, 29 insertions(+), 22 deletions(-)
diff --git a/content/handlers/html/box_textarea.c
b/content/handlers/html/box_textarea.c
index 8b4fdf9..e253e16 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -43,24 +43,32 @@ nserror box_textarea_keypress(html_content *html, struct
box *box, uint32_t key)
struct form_control *gadget = box->gadget;
struct textarea *ta = gadget->data.text.ta;
struct form* form = box->gadget->form;
- struct content *c = (struct content *) html;
+ struct content *c = (struct content *)html;
nserror res = NSERROR_OK;
assert(ta != NULL);
- if (gadget->type != GADGET_TEXTAREA) {
- switch (key) {
- case NS_KEY_NL:
- case NS_KEY_CR:
- if (form) {
- res = form_submit(content_get_url(c),
- html->bw,
- form,
- NULL);
- }
- break;
+ if (gadget->type == GADGET_TEXTAREA) {
+ if (textarea_keypress(ta, key)) {
+ return NSERROR_OK;
+ } else {
+ return NSERROR_INVALID;
+ }
+ }
+
+ /* non textarea input */
+ switch (key) {
+ case NS_KEY_NL:
+ case NS_KEY_CR:
+ if (form) {
+ res = form_submit(content_get_url(c),
+ html->bw,
+ form,
+ NULL);
+ }
+ break;
- case NS_KEY_TAB:
+ case NS_KEY_TAB:
{
struct form_control *next_input;
/* Find next text entry field that is actually
@@ -79,9 +87,9 @@ nserror box_textarea_keypress(html_content *html, struct box
*box, uint32_t key)
textarea_set_caret(next_input->data.text.ta, 0);
}
}
- break;
+ break;
- case NS_KEY_SHIFT_TAB:
+ case NS_KEY_SHIFT_TAB:
{
struct form_control *prev_input;
/* Find previous text entry field that is actually
@@ -100,15 +108,14 @@ nserror box_textarea_keypress(html_content *html, struct
box *box, uint32_t key)
textarea_set_caret(prev_input->data.text.ta, 0);
}
}
- break;
+ break;
- default:
- /* Pass to textarea widget */
- if (!textarea_keypress(ta, key)) {
- res = NSERROR_INVALID;
- }
- break;
+ default:
+ /* Pass to textarea widget */
+ if (!textarea_keypress(ta, key)) {
+ res = NSERROR_INVALID;
}
+ break;
}
return res;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org