From 2344774db3c35df4d8e0d140dfafc6e10c7ccde1 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Thu, 7 Nov 2013 11:24:34 +0100
Subject: [PATCH] Allow hinting ';e' and 'gi' also for input without type
 attribute.

This enables to focus the search box of google, that has not type attribute.
---
 src/dom.c    | 2 +-
 src/hints.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/dom.c b/src/dom.c
index f13c3af..4d25cb8 100644
--- a/src/dom.c
+++ b/src/dom.c
@@ -91,7 +91,7 @@ gboolean dom_focus_input(WebKitWebView *view)
     }
 
     result = webkit_dom_document_evaluate(
-        doc, "//input[@type='text']|//input[@type='password']|//textarea",
+        doc, "//input[not(@type) or @type='text' or @type='password']|//textarea",
         html, resolver, 0, NULL, NULL
     );
     if (!result) {
diff --git a/src/hints.js b/src/hints.js
index 164703c..666c8e6 100644
--- a/src/hints.js
+++ b/src/hints.js
@@ -377,11 +377,11 @@ var VbHint = (function(){
                 );
             case "e":
                 if (!s) {
-                    return "//input[@type='text'] | //textarea";
+                    return "//input[not(@type) or @type='text'] | //textarea";
                 }
                 return buildQuery(
                     ["@value", ".", "@placeholder"],
-                    "//input[@type='text' and ($@value or $@placeholder)] | //textarea[$.]",
+                    "//input[(not(@type) or @type='text') and ($@value or $@placeholder)] | //textarea[$.]",
                     s
                 );
             case "i":
-- 
2.20.1