Don't switch to input mode on click to radio button.
authorDaniel Carl <danielcarl@gmx.de>
Sun, 9 Nov 2014 23:36:39 +0000 (00:36 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 9 Nov 2014 23:36:39 +0000 (00:36 +0100)
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.

src/dom.c

index 49c3d91..bd6f6a5 100644 (file)
--- 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 {