Fixed wrong check if a fired hint is an input.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 16 Feb 2013 10:46:31 +0000 (11:46 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 16 Feb 2013 10:51:55 +0000 (11:51 +0100)
We considered every html form input element as editable. This brakes the next
submit element on duckduckgo's search result page.

Now we exclude the input type submit, reset and image from the editable input
elements.

src/dom.c

index f805e91..9ebba04 100644 (file)
--- a/src/dom.c
+++ b/src/dom.c
@@ -126,11 +126,13 @@ gboolean dom_is_editable(Element* element)
     }
     char *type = webkit_dom_element_get_attribute(element, "type");
     if (!g_ascii_strcasecmp(tagname, "input")
-        || !g_ascii_strcasecmp(type, "text")
-        || !g_ascii_strcasecmp(type, "password")
+        && g_ascii_strcasecmp(type, "submit")
+        && g_ascii_strcasecmp(type, "reset")
+        && g_ascii_strcasecmp(type, "image")
     ) {
         return TRUE;
     }
+
     return FALSE;
 }