From: Daniel Carl Date: Sun, 9 Nov 2014 23:36:39 +0000 (+0100) Subject: Don't switch to input mode on click to radio button. X-Git-Url: https://git.owens.tech/assets/editable-focus.html/assets/editable-focus.html/git?a=commitdiff_plain;h=1ed2760de23e4f92028dadf7b5742cfef2090557;p=vimb.git Don't switch to input mode on click to radio button. If a radio button was clicked vimb switched to input mode. Now the logic what element is editable is consistent within dom.c. Editable are textarea, and input elements without any type a and type text or password. --- diff --git a/src/dom.c b/src/dom.c index 49c3d91..bd6f6a5 100644 --- a/src/dom.c +++ b/src/dom.c @@ -124,12 +124,12 @@ gboolean dom_is_editable(Element *element) tagname = webkit_dom_element_get_tag_name(element); type = webkit_dom_element_get_attribute(element, "type"); + /* element is editable if it's a text area or input with no type, text or + * pasword */ if (!g_ascii_strcasecmp(tagname, "textarea")) { result = true; } else if (!g_ascii_strcasecmp(tagname, "input") - && g_ascii_strcasecmp(type, "submit") - && g_ascii_strcasecmp(type, "reset") - && g_ascii_strcasecmp(type, "image") + && (!*type || !g_ascii_strcasecmp(type, "text") || !g_ascii_strcasecmp(type, "password")) ) { result = true; } else {