From af19c0c481e44fbb873d60c33cd1724747faa949 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Marie?= Date: Sun, 26 Apr 2015 12:39:44 +0200 Subject: [PATCH] add HTML5 input type to dom_focus_input Allow new HTML input type to be found by dom_focus_input as editable field. Reformat a little the xpath expression in order to have a lisible string. Close: #204 --- src/dom.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/dom.c b/src/dom.c index f53876a..a151d6b 100644 --- a/src/dom.c +++ b/src/dom.c @@ -103,9 +103,22 @@ void dom_focus_input(WebKitWebView *view) /* 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 translate(@type,'ETX','etx')='text' " + doc, "//input[not(@type) " + "or translate(@type,'ETX','etx')='text' " "or translate(@type,'ADOPRSW','adoprsw')='password' " - "or translate(@type,'ACEHRS','acehrs')='search']|//textarea", + "or translate(@type,'CLOR','clor')='color' " + "or translate(@type,'ADET','adet')='date' " + "or translate(@type,'ADEIMT','adeimt')='datetime' " + "or translate(@type,'ACDEILMOT','acdeilmot')='datetime-local' " + "or translate(@type,'AEILM','aeilm')='email' " + "or translate(@type,'HMNOT','hmnot')='month' " + "or translate(@type,'BEMNRU','bemnru')='number' " + "or translate(@type,'ACEHRS','acehrs')='search' " + "or translate(@type,'ELT','elt')='tel' " + "or translate(@type,'EIMT','eimt')='time' " + "or translate(@type,'LRU','lru')='url' " + "or translate(@type,'EKW','ekw')='week' " + "]|//textarea", html, resolver, 5, NULL, NULL ); if (!result) { -- 2.20.1