Check for DOM focus/blur events as soon as possible (#197).
authorDaniel Carl <danielcarl@gmx.de>
Sun, 5 Apr 2015 11:04:40 +0000 (13:04 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 5 Apr 2015 11:05:12 +0000 (13:05 +0200)
This is required to remove focus in strict-focus=true even when the focus is
set to an editable element before the page is completely loaded. The previous
logic caused the cursor to be visible in form filed but vimb where still in
normals mode.

src/main.c

index 7f7168a..b92d650 100644 (file)
@@ -763,6 +763,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
             if (vb.mode->id == 'i') {
                 vb_enter('n');
             }
+            dom_check_auto_insert(view);
             break;
 
         case WEBKIT_LOAD_FINISHED:
@@ -776,7 +777,6 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
             update_title();
 
             if (strncmp(uri, "about:", 6)) {
-                dom_check_auto_insert(view);
                 history_add(HISTORY_URL, uri, webkit_web_view_get_title(view));
             }
             break;