From: Daniel Carl Date: Thu, 7 Nov 2013 10:24:34 +0000 (+0100) Subject: Allow hinting ';e' and 'gi' also for input without type attribute. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=2344774db3c35df4d8e0d140dfafc6e10c7ccde1;p=vimb.git 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. --- 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":