r13759 vince - /trunk/netsurf/css/select.c

netsurf at semichrome.net netsurf at semichrome.net
Wed Mar 28 17:13:23 BST 2012


Author: vince
Date: Wed Mar 28 11:13:23 2012
New Revision: 13759

URL: http://source.netsurf-browser.org?rev=13759&view=rev
Log:
converted node_presentational_hint_border_spacing

Modified:
    trunk/netsurf/css/select.c

Modified: trunk/netsurf/css/select.c
URL: http://source.netsurf-browser.org/trunk/netsurf/css/select.c?rev=13759&r1=13758&r2=13759&view=diff
==============================================================================
--- trunk/netsurf/css/select.c (original)
+++ trunk/netsurf/css/select.c Wed Mar 28 11:13:23 2012
@@ -2380,30 +2380,42 @@
 					  dom_node *node, 
 					  css_hint *hint)
 {
-#ifdef FIXME
-	xmlChar *cellspacing;
-
-	if (strcmp((const char *) n->name, "table") != 0)
+	dom_exception err;
+	dom_string *node_name = NULL;
+	dom_string *cellspacing = NULL;
+
+	err = dom_node_get_node_name(node, &node_name);
+	if ((err != DOM_NO_ERR) || (node_name == NULL)) {
 		return CSS_PROPERTY_NOT_SET;
-
-	cellspacing = xmlGetProp(n, (const xmlChar *) "cellspacing");
-	if (cellspacing == NULL)
+	}
+
+	if (!dom_string_caseless_isequal(node_name, nscss_dom_string_table)) {
+		dom_string_unref(node_name);
 		return CSS_PROPERTY_NOT_SET;
-
-	if (parse_dimension((const char *) cellspacing, false,
+	}
+
+	dom_string_unref(node_name);
+
+	err = dom_element_get_attribute(node, nscss_dom_string_cellspacing, &cellspacing);
+	if ((err != DOM_NO_ERR) || (cellspacing == NULL)) {
+		return CSS_PROPERTY_NOT_SET;
+	}
+
+
+	if (parse_dimension((const char *)dom_string_data(cellspacing), 
+			    false,
 			    &hint->data.position.h.value,
 			    &hint->data.position.h.unit)) {
+
 		hint->data.position.v = hint->data.position.h;
 		hint->status = CSS_BORDER_SPACING_SET;
-	} else {
-		xmlFree(cellspacing);
-		return CSS_PROPERTY_NOT_SET;
-	}
-
-	xmlFree(cellspacing);
-
-	return CSS_OK;
-#endif
+
+		dom_string_unref(cellspacing);
+		return CSS_OK;
+
+	}
+
+	dom_string_unref(cellspacing);
 	return CSS_PROPERTY_NOT_SET;
 }
 




More information about the netsurf-commits mailing list