1. portix
  2. dwb

Commits

portix  committed 139d375

Replace domelement functions with nodefunctions in dom.c

  • Participants
  • Parent commits 4229898
  • Branches master

Comments (0)

Files changed (2)

File src/dom.c

View file
     }
     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) 
 {
             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);

File src/dwb.c

View file
 void 
 dwb_update_status_text(GList *gl, GtkAdjustment *a) 
 {
-    g_return_if_fail(gl == dwb.state.fview);
+    if (gl == dwb.state.fview)
+        return;
 
     if (dwb_emit_status_signal(gl, "status"))
         return;