summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-18 19:47:20 +0100
committerportix <none@none>2012-11-18 19:47:20 +0100
commit1ed7f2b6e9362761647e6a2c3fabc7ab5e41d943 (patch)
tree99c3f9ee5ceb4defed7552361a7d9785117196b2 /src
parentf126e00cd9d055dc445cbd1ccda552d62c947703 (diff)
downloaddwb-1ed7f2b6e9362761647e6a2c3fabc7ab5e41d943.zip
Check if target element is a dom-element in html_key_down_cb
Diffstat (limited to 'src')
-rw-r--r--src/html.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/html.c b/src/html.c
index 2637430f..81b39046 100644
--- a/src/html.c
+++ b/src/html.c
@@ -255,7 +255,7 @@ html_keydown_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
glong val = webkit_dom_ui_event_get_key_code(WEBKIT_DOM_UI_EVENT(ev));
if (val == 13) {
WebKitDOMEventTarget *target = webkit_dom_event_get_target(ev);
- if (target != NULL) {
+ if (target != NULL && WEBKIT_DOM_IS_ELEMENT(target)) {
return html_key_changed(WEBKIT_DOM_ELEMENT(target));
}
}
@@ -327,8 +327,10 @@ html_key_changed(WebKitDOMElement *target) {
char *value;
if (WEBKIT_DOM_IS_HTML_TEXT_AREA_ELEMENT(target))
value = webkit_dom_html_text_area_element_get_value(WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT(target));
- else
+ else if (WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(target))
value = webkit_dom_html_input_element_get_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(target));
+ else
+ return false;
char *id = webkit_dom_html_element_get_id(WEBKIT_DOM_HTML_ELEMENT(target));
if (g_strcmp0(id, "dwb_custom_keys_area")) {