From: Daniel Carl Date: Thu, 2 Apr 2015 20:37:39 +0000 (+0200) Subject: Use case insensitive xpath for focus input (#198). X-Git-Url: https://git.owens.tech/assets/lich_lifts_title_slice.png/assets/lich_lifts_title_slice.png/git?a=commitdiff_plain;h=ecb434c9b9c795e7977815ba832b01d0b503171f;p=vimb.git Use case insensitive xpath for focus input (#198). --- diff --git a/src/dom.c b/src/dom.c index 5850cc1..af13ae4 100644 --- a/src/dom.c +++ b/src/dom.c @@ -94,9 +94,12 @@ gboolean dom_focus_input(WebKitWebView *view) return false; } + /* Use translate to match xpath expression case insensitive so that also + * intput filed of type="TEXT" are matched. */ result = webkit_dom_document_evaluate( - doc, "//input[not(@type) or @type='text' or @type='password']|//textarea", - html, resolver, 0, NULL, NULL + doc, "//input[not(@type) or translate(@type,'ETX','etx')='text' " + "or translate(@type,'ADOPRSW','adoprsw')='password']|//textarea", + html, resolver, 5, NULL, NULL ); if (!result) { return false;