about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@conformal.com>2013-07-10 09:56:44 -0400
committerJosh Rickmar <jrick@conformal.com>2013-07-10 09:56:44 -0400
commit569f827d97415ebb9b074e23385a36ffd4f85fda (patch)
tree2072a5269125a5a73148eb123dd053489fcad6b2
parent5b1ee64417bece200bef05972a0d4ac205120121 (diff)
downloadxombrero-569f827d97415ebb9b074e23385a36ffd4f85fda.tar.gz
Check if the DOM node is a WebKitDOMHTMLDocument.
-rw-r--r--inputfocus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/inputfocus.c b/inputfocus.c
index eb46841..b5b4e19 100644
--- a/inputfocus.c
+++ b/inputfocus.c
@@ -159,7 +159,7 @@ focus_input(struct tab *t)
 
 	/* try current active element */
 	a = webkit_dom_html_document_get_active_element(
-	    (WebKitDOMHTMLDocument*)doc);
+	    WEBKIT_DOM_HTML_DOCUMENT(doc);
 	if (node_is_valid_entry((WebKitDOMNode *)a)) {
 		rv = 1; /* found */
 		goto done;
@@ -245,6 +245,8 @@ dom_is_input(struct tab *t, char **text)
 
 	/* unwind frames and iframes until the cows come home */
 	for (;;) {
+		if (!WEBKIT_DOM_IS_HTML_DOCUMENT(doc))
+			return (0);
 		a = webkit_dom_html_document_get_active_element(
 		    (WebKitDOMHTMLDocument*)doc);
 		if (a == NULL)