changeset 24688:dce57ce0b860

Change the way we handle <span style='font-size: whatever;'> tags slightly. We really only support a few specific values for that css attribute--we don't support things like "12pt" for example. But this code was setting <font size="3"> for any unknown font-size css value. So if someone specified a css font-size of 72px we set the font size to 3, which is basically the default font size, which is clearly wrong. So change this to just do nothing if we don't understand the value.
author Mark Doliner <mark@kingant.net>
date Mon, 15 Dec 2008 01:13:17 +0000
parents bca23aa61d0f
children e268ad14e693
files pidgin/gtkimhtml.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c	Mon Dec 15 00:40:36 2008 +0000
+++ b/pidgin/gtkimhtml.c	Mon Dec 15 01:13:17 2008 +0000
@@ -3126,9 +3126,15 @@
 								font->size = 6;
 							else if (g_ascii_strcasecmp(size, "xx-large") == 0)
 								font->size = 7;
-							else
-								font->size = 3;
-						    gtk_imhtml_font_set_size(imhtml, font->size);
+
+							/*
+							 * TODO: Handle other values, like percentages, or
+							 * lengths specified as em, ex, px, in, cm, mm, pt
+							 * or pc.  Or even better, use an actual HTML
+							 * renderer like webkit.
+							 */
+							if (font->size > 0)
+							    gtk_imhtml_font_set_size(imhtml, font->size);
 						}
 						else if (oldfont)
 						{