summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2015-04-02 22:37:39 +0200
committerDaniel Carl <danielcarl@gmx.de>2015-04-02 22:37:39 +0200
commitecb434c9b9c795e7977815ba832b01d0b503171f (patch)
treee0f343523088cb276bd98b8cb8ca26291e486bc4
parente4c96815ddf355266aee3b771f59f3d647910ed7 (diff)
Use case insensitive xpath for focus input (#198).
-rw-r--r--src/dom.c7
1 files changed, 5 insertions, 2 deletions
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;