r5259 tlsa - in /trunk/netsurf: css/css.c render/box_construct.c

netsurf at semichrome.net netsurf at semichrome.net
Fri Sep 5 14:04:30 BST 2008


Author: tlsa
Date: Fri Sep  5 08:04:30 2008
New Revision: 5259

URL: http://source.netsurf-browser.org?rev=5259&view=rev
Log:
Add comments and change height attribute handling on TR to only alter the height if attribute height is greater than current height.

Modified:
    trunk/netsurf/css/css.c
    trunk/netsurf/render/box_construct.c

Modified: trunk/netsurf/css/css.c
URL: http://source.netsurf-browser.org/trunk/netsurf/css/css.c?rev=5259&r1=5258&r2=5259&view=diff
==============================================================================
--- trunk/netsurf/css/css.c (original)
+++ trunk/netsurf/css/css.c Fri Sep  5 08:04:30 2008
@@ -131,7 +131,7 @@
 		xmlNode *element);
 static bool css_match_first_child(const struct css_selector *detail,
 		xmlNode *element);
-static void css_dump_length(FILE *stream, 
+static void css_dump_length(FILE *stream,
 		const struct css_length * const length);
 static void css_dump_selector(const struct css_selector *r);
 #ifdef DEBUG_WORKING_STYLESHEET
@@ -2065,7 +2065,7 @@
 			fprintf(stream, "inherit");
 			break;
 		case CSS_MIN_HEIGHT_LENGTH:
-			css_dump_length(stream, 
+			css_dump_length(stream,
 					&style->min_height.value.length);
 			break;
 		case CSS_MIN_HEIGHT_PERCENT:
@@ -3151,22 +3151,29 @@
 			if ((font.value = css_len2pt(&style->
 					font_size.value.length, style)) <
 					option_font_min_size / 10) {
+				/* min font size is greater than given length so
+				 * use min font size for conversion to px */
 				font.value = option_font_min_size / 10;
 				return length->value * css_len2px(&font,
-					style);
+						style);
 			} else
+				/* use given length for conversion to px */
 				return length->value * css_len2px(&style->
-					font_size.value.length, 0);
+						font_size.value.length, 0);
 		case CSS_UNIT_EX:
 			if ((font.value = css_len2pt(&style->
 					font_size.value.length, style)) <
 					option_font_min_size / 10) {
+				/* min font size is greater than given length so
+				 * use min font size for conversion to px */
 				font.value = option_font_min_size / 10;
 				return length->value * css_len2px(&font,
-					style) * 0.6;
+						style) * 0.6;
 			} else
+				/* use given length for conversion to px */
 				return length->value * css_len2px(&style->
-					font_size.value.length, 0) * 0.6;
+						font_size.value.length, 0) *
+						0.6;
 		case CSS_UNIT_PX: return length->value;
 		/* We assume the screen and any other output has the same dpi */
 		case CSS_UNIT_IN: return length->value * css_screen_dpi;

Modified: trunk/netsurf/render/box_construct.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/box_construct.c?rev=5259&r1=5258&r2=5259&view=diff
==============================================================================
--- trunk/netsurf/render/box_construct.c (original)
+++ trunk/netsurf/render/box_construct.c Fri Sep  5 08:04:30 2008
@@ -578,12 +578,14 @@
 				float current;
 				for (child = box->children; child;
 							child = child->next) {
-					if (child->type == BOX_TABLE_CELL) {
-						current = css_len2px(
+					current = css_len2px(
 							&child->style->height.
 							length, child->style);
-						value = (value > current) ?
-							value : current;
+					if (child->type == BOX_TABLE_CELL &&
+							value > current) {
+						/* Row height exceeds cell
+						 * height, increase cell height
+						 * to row height */
 						child->style->height.height =
 							CSS_HEIGHT_LENGTH;
 						child->style->height.length.




More information about the netsurf-commits mailing list