Fixed not leaved input mode on form submit (#197).
authorDaniel Carl <danielcarl@gmx.de>
Fri, 3 Apr 2015 20:56:55 +0000 (22:56 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 3 Apr 2015 20:56:55 +0000 (22:56 +0200)
commit49f5e9eb0084d15a002a5bc9bc1500e848338bac
tree17e78af4fb4c78752993e6c5e429429b8c6ccf57
parentecb434c9b9c795e7977815ba832b01d0b503171f
Fixed not leaved input mode on form submit (#197).

The previous logic of switching back to normal mode in
webview_load_status_cb() does only work for google search or if the place
where we switch back to normal mode is change for translate.google.com. But
this would have never been working for both sites.

This patch tries another approach and doe the switching back to normal mode
also by observing dom events. In case the strict-focus is enabled the focus
event callback blur the active element to keep vimb in it's current mode. If
vimb is in input mode the focus is not removed from the element, which allows
to to keep in input mode if this was started by user interaction like 'gi'
normal mode command, hinting or click to editable element.

There are two way's to obtain the input mode.
1. By user interaction: where vimb is set to input mode and after that the
   form element is focused, or where the input mode is set right after the dom
   event observer took their decision.
2. By the page: Only the focus/blur state of the editable active element
   changes and vimb pick this state changes up and follows this, or remove the
   focus in case of enabled strict-focus.
src/dom.c
src/dom.h
src/main.c
src/normal.c