summaryrefslogtreecommitdiff
path: root/src/dom.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-04-17 00:58:17 +0200
committerportix <portix@gmx.net>2013-04-17 00:58:17 +0200
commit139d3753d668178ef4ea77b64a53769ce11e683e (patch)
tree5f7f9771d9dec5020835fcc8476b39516d3bbf3d /src/dom.c
parent42298980c4e9a855530123045c5b42bbbd99653f (diff)
downloaddwb-139d3753d668178ef4ea77b64a53769ce11e683e.zip
Replace domelement functions with nodefunctions in dom.c
Diffstat (limited to 'src/dom.c')
-rw-r--r--src/dom.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/dom.c b/src/dom.c
index ce308eab..23472d3a 100644
--- a/src/dom.c
+++ b/src/dom.c
@@ -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);