Index: src/select/properties/font_family.c
===================================================================
--- src/select/properties/font_family.c	(revision 13101)
+++ src/select/properties/font_family.c	(working copy)
@@ -99,6 +99,26 @@
 		fonts = temp;
 
 		fonts[n_fonts] = NULL;
+		
+		if (value == CSS_FONT_FAMILY_INHERIT) {
+			/* The stylesheet doesn't specify a system font at all,
+			 * but it has specified named fonts.
+			 * Fall back to the user agent's default system font.
+			 * We don't want to inherit, because that will 
+			 * incorrectly overwrite the named fonts list too.
+			 */
+			
+			css_hint hint;
+			css_error error;
+			
+			error = state->handler->ua_default_for_property(
+					state->pw, CSS_PROP_FONT_FAMILY, &hint);
+			
+			if (error != CSS_OK)
+				return error;
+			
+			value = hint.status;
+		}
 	}
 
 	if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
@@ -155,29 +175,29 @@
 		css_computed_style *result)
 {
 	css_error error;
-	lwc_string **urls = NULL;
-	uint8_t type = get_font_family(child, &urls);
+	lwc_string **names = NULL;
+	uint8_t type = get_font_family(child, &names);
 
 	if (type == CSS_FONT_FAMILY_INHERIT || result != child) {
-		size_t n_urls = 0;
+		size_t n_names = 0;
 		lwc_string **copy = NULL;
 
 		if (type == CSS_FONT_FAMILY_INHERIT)
-			type = get_font_family(parent, &urls);
+			type = get_font_family(parent, &names);
 
-		if (urls != NULL) {
+		if (names != NULL) {
 			lwc_string **i;
 
-			for (i = urls; (*i) != NULL; i++)
-				n_urls++;
+			for (i = names; (*i) != NULL; i++)
+				n_names++;
 
-			copy = result->alloc(NULL, (n_urls + 1) * 
+			copy = result->alloc(NULL, (n_names + 1) * 
 					sizeof(lwc_string *),
 					result->pw);
 			if (copy == NULL)
 				return CSS_NOMEM;
 
-			memcpy(copy, urls, (n_urls + 1) * 
+			memcpy(copy, names, (n_names + 1) * 
 					sizeof(lwc_string *));
 		}
 
