diff options
author | portix <portix@gmx.net> | 2013-04-17 00:58:17 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2013-04-17 00:58:17 +0200 |
commit | 139d3753d668178ef4ea77b64a53769ce11e683e (patch) | |
tree | 5f7f9771d9dec5020835fcc8476b39516d3bbf3d /src/dom.c | |
parent | 42298980c4e9a855530123045c5b42bbbd99653f (diff) | |
download | dwb-139d3753d668178ef4ea77b64a53769ce11e683e.zip |
Replace domelement functions with nodefunctions in dom.c
Diffstat (limited to 'src/dom.c')
-rw-r--r-- | src/dom.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -32,6 +32,13 @@ dom_node_get_attribute(WebKitDOMNode *node, const char *attribute) } return NULL; } +static WebKitDOMDOMWindow * +dom_node_get_default_view(WebKitDOMNode *node) +{ + g_return_val_if_fail(WEBKIT_DOM_IS_NODE(node), NULL); + WebKitDOMDocument *doc = webkit_dom_node_get_owner_document(node); + return webkit_dom_document_get_default_view(doc); +} gboolean dom_add_frame_listener(WebKitWebFrame *frame, const char *signal, GCallback callback, gboolean bubble, GList *gl) { @@ -53,13 +60,13 @@ dom_add_frame_listener(WebKitWebFrame *frame, const char *signal, GCallback call tagname = webkit_dom_node_get_node_name(node); if (!g_ascii_strcasecmp(tagname, "iframe")) { - framesrc = webkit_dom_html_iframe_element_get_src(WEBKIT_DOM_HTML_IFRAME_ELEMENT(node)); - win = webkit_dom_html_iframe_element_get_content_window(WEBKIT_DOM_HTML_IFRAME_ELEMENT(node)); + framesrc = dom_node_get_attribute(node, "src"); + win = dom_node_get_default_view(node); } else { - framesrc = webkit_dom_html_frame_element_get_src(WEBKIT_DOM_HTML_FRAME_ELEMENT(node)); - win = webkit_dom_html_frame_element_get_content_window(WEBKIT_DOM_HTML_FRAME_ELEMENT(node)); + framesrc = dom_node_get_attribute(node, "src"); + win = dom_node_get_default_view(node); } if (!g_strcmp0(src, framesrc)) ret = webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(win), signal, callback, true, gl); |