static Element *get_active_element(Document *doc);
-void dom_check_auto_insert(void)
+void dom_check_auto_insert(WebKitWebView *view)
{
- Document *doc = webkit_web_view_get_dom_document(vb.gui.webview);
+ Document *doc = webkit_web_view_get_dom_document(view);
Element *active = get_active_element(doc);
/* the focus was not set automatically - add event listener to track focus
/**
* Remove focus from active and editable elements.
*/
-void dom_clear_focus(void)
+void dom_clear_focus(WebKitWebView *view)
{
- Document *doc = webkit_web_view_get_dom_document(vb.gui.webview);
- Element *active = get_active_element(doc);
-
+ Element *active = dom_get_active_element(view);
if (active) {
webkit_dom_element_blur(active);
}
return result;
}
+Element *dom_get_active_element(WebKitWebView *view)
+{
+ return get_active_element(webkit_web_view_get_dom_document(view));
+}
+
static gboolean auto_insert(Element *element)
{
if (dom_is_editable(element)) {
gulong bottom;
} DomBoundingRect;
-void dom_check_auto_insert(void);
-void dom_clear_focus(void);
+void dom_check_auto_insert(WebKitWebView *view);
+void dom_clear_focus(WebKitWebView *view);
gboolean dom_is_editable(Element *element);
+Element *dom_get_active_element(WebKitWebView *view);
#endif /* end of include guard: _DOM_H */
switch (clean_old) {
case VB_MODE_INSERT:
clean = true;
- dom_clear_focus();
+ dom_clear_focus(vb.gui.webview);
break;
case VB_MODE_HINTING:
vb.state.progress = 100;
vb_update_statusbar();
- dom_check_auto_insert();
+ dom_check_auto_insert(view);
history_add(HISTORY_URL, uri);
break;